Wie man Ansible ausführen einer bestimmten Aufgabe, die nur auf einem Rechner?

Dem playbook sieht wie folgt aus:

- hosts: all
  tasks:
    - name: "run on all hosts,1"
      shell: something1
    - name: "run on all hosts,2"
      shell: something2
    - name: "run on one host, any host would do"
      shell: this_command_should_run_on_one_host
    - name: "run on all hosts,3"
      shell: something3

Kenne mich mit Kommandozeilen-option --limit kann ich limit auf einen host, ist es möglich, es zu tun im playbook?

Hinzufügen run_once: true zu der Aufgabe.

InformationsquelleAutor nuster cache server | 2017-11-17

Schreibe einen Kommentar