Nach dem Ausführen der die folgenden ansible YAML-Datei zeigt die Ausgabe-Datei erstellt wird und der Inhalt geändert wirdansible Erstellung der Datei nicht ohne Fehler
Die YAML Datei
---
- hosts: all
gather_facts: yes
connection: local
tasks:
- name: Check the date on the server.
action: command touch /opt/b
- name: cat the Content
action: command cat /opt/b
Ausführen des Textbuch
[email protected]:/var/lib/awx/projects/test# ansible-playbook main.yml
PLAY [all] *********************************************************************
TASK [setup] *******************************************************************
ok: [ansible-ubuntu-1604-db]
TASK [Check the date on the server.] *******************************************
changed: [ansible-ubuntu-1604-db]
[WARNING]: Consider using file module with state=touch rather than running touch
TASK [cat the Content] *********************************************************
changed: [ansible-ubuntu-1604-db]
PLAY RECAP *********************************************************************
ansible-ubuntu-1604-db : ok=3 changed=2 unreachable=0 failed=0
Das Meldungsdisplay c = 2 und Aufgaben hängen müssen nicht jede Datei erstellt
[email protected]:~$ ls -l /opt/
total 0
Die Env
- ansible-Controller auf dem MAC lokalen Desktop
- Tagte Knoten ist auf Wolke