1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
| $ vi playbook.yml
$ ansible-playbook -i hosts playbook.yml -K SUDO password:
PLAY [test-hosts] **************************************************************
TASK [setup] ******************************************************************* ok: [192.168.1.201]
TASK [command] ***************************************************************** changed: [192.168.1.201]
TASK [debug] ******************************************************************* ok: [192.168.1.201] => { "result": { "changed": true, "cmd": "/usr/bin/uptime", "delta": "0:00:00.004671", "end": "2020-06-11 18:52:23.186351", "rc": 0, "start": "2020-06-11 18:52:23.181680", "stderr": "", "stdout": " 18:52:23 up 126 days, 5:40, 2 users, load average: 0.48, 0.51, 0.68", "stdout_lines": [ " 18:52:23 up 126 days, 5:40, 2 users, load average: 0.48, 0.51, 0.68" ], "warnings": [] } }
TASK [Display all variables/facts known for a host] **************************** ok: [192.168.1.201] => { "hostvars[inventory_hostname]": { "ansible_all_ipv4_addresses": [ "192.168.1.201", "172.17.0.1", "172.23.0.1", "172.18.0.1" ], "ansible_all_ipv6_addresses": [ ... "result": { "changed": true, "cmd": "/usr/bin/uptime", "delta": "0:00:00.004671", "end": "2020-06-11 18:52:23.186351", "rc": 0, "start": "2020-06-11 18:52:23.181680", "stderr": "", "stdout": " 18:52:23 up 126 days, 5:40, 2 users, load average: 0.48, 0.51, 0.68", "stdout_lines": [ " 18:52:23 up 126 days, 5:40, 2 users, load average: 0.48, 0.51, 0.68" ], "warnings": [] } } }
PLAY RECAP ********************************************************************* 192.168.1.201 : ok=4 changed=1 unreachable=0 failed=0
|