ansible Befehl ausführen auf Remote-Host im Hintergrund

Ich versuche, den Dateibeat-Prozess (oder jeden anderen Prozess, der bei Bedarf kontinuierlich ausgeführt wird) auf mehreren Hosts mit ansible zu starten. Ich möchte nicht, dass man warten muss, bis der Prozess weiterläuft. Ich möchte, dass Ansible feuert und vergisst und herauskommt und Remote-Prozesse im Hintergrund laufen lässt. Ich habe versucht, die folgenden Optionen zu verwenden:

    ---
    - hosts: filebeat
      tasks:
      - name: start filebeat
option a)  command: filebeat -c filebeat.yml &
option b)  command: nohup filebeat -c filebeat.yml &
option c)  shell: filebeat -c filebeat.yml &
           async: 0 //Tried without as well. If its > 0 then it only waits for that much of time and terminates the filebeat process on remote host and comes out.
           poll: 0

Antworten auf die Frage(2)

Ihre Antwort auf die Frage