· 6 years ago · Oct 30, 2019, 04:56 PM
1jinja2.yml
2
3PLAY [PLAYBOOK Info Configure Manager] **************************************************************************************************************************************
4
5TASK [Get info running show managers] ***************************************************************************************************************************************
6ok: [localhost -> 192.168.45.46] => (item={'FTDIPAddress': '192.168.45.46', 'ManagerIPAddress': '192.168.45.45', 'SecretKey': 'cisco123'})
7failed: [localhost] (item={'FTDIPAddress': '192.168.128.123', 'ManagerIPAddress': '192.168.128.119', 'SecretKey': 'cisco123'}) => {"ansible_loop_var": "item", "item": {"FTDIPAddress": "192.168.128.123", "ManagerIPAddress": "192.168.128.119", "SecretKey": "cisco123"}, "msg": "Failed to connect to the host via ssh: ssh: connect to host 192.168.128.123 port 22: Connection timed out", "unreachable": true}
8fatal: [localhost]: UNREACHABLE! => {"changed": false, "msg": "All items completed", "results": [{"ansible_loop_var": "item", "changed": false, "failed": false, "item": {"FTDIPAddress": "192.168.45.46", "ManagerIPAddress": "192.168.45.45", "SecretKey": "cisco123"}, "rc": 0, "stderr": "Shared connection to 192.168.45.46 closed.\r\n", "stderr_lines": ["Shared connection to 192.168.45.46 closed."], "stdout": "No managers configured.\r\n\r\n", "stdout_lines": ["No managers configured.", ""]}, {"ansible_loop_var": "item", "item": {"FTDIPAddress": "192.168.128.123", "ManagerIPAddress": "192.168.128.119", "SecretKey": "cisco123"}, "msg": "Failed to connect to the host via ssh: ssh: connect to host 192.168.128.123 port 22: Connection timed out", "unreachable": true}], "skip_reason": "Host localhost is unreachable"}
9
10TASK [set_fact] *************************************************************************************************************************************************************
11ok: [localhost]
12
13TASK [DEBUG0] ***************************************************************************************************************************************************************
14ok: [localhost] => (item={'rc': 0, 'stdout': 'No managers configured.\r\n\r\n', 'stdout_lines': ['No managers configured.', ''], 'stderr': 'Shared connection to 192.168.45.46 closed.\r\n', 'stderr_lines': ['Shared connection to 192.168.45.46 closed.'], 'changed': False, 'failed': False, 'item': {'FTDIPAddress': '192.168.45.46', 'ManagerIPAddress': '192.168.45.45', 'SecretKey': 'cisco123'}, 'ansible_loop_var': 'item'}) => {
15 "msg": {
16 "ansible_loop_var": "item",
17 "changed": false,
18 "failed": false,
19 "item": {
20 "FTDIPAddress": "192.168.45.46",
21 "ManagerIPAddress": "192.168.45.45",
22 "SecretKey": "cisco123"
23 },
24 "rc": 0,
25 "stderr": "Shared connection to 192.168.45.46 closed.\r\n",
26 "stderr_lines": [
27 "Shared connection to 192.168.45.46 closed."
28 ],
29 "stdout": "No managers configured.\r\n\r\n",
30 "stdout_lines": [
31 "No managers configured.",
32 ""
33 ]
34 }
35}
36ok: [localhost] => (item={'unreachable': True, 'msg': 'Failed to connect to the host via ssh: ssh: connect to host 192.168.128.123 port 22: Connection timed out', 'item': {'FTDIPAddress': '192.168.128.123', 'ManagerIPAddress': '192.168.128.119', 'SecretKey': 'cisco123'}, 'ansible_loop_var': 'item'}) => {
37 "msg": {
38 "ansible_loop_var": "item",
39 "item": {
40 "FTDIPAddress": "192.168.128.123",
41 "ManagerIPAddress": "192.168.128.119",
42 "SecretKey": "cisco123"
43 },
44 "msg": "Failed to connect to the host via ssh: ssh: connect to host 192.168.128.123 port 22: Connection timed out",
45 "unreachable": true
46 }
47}
48
49TASK [DEBUG1] ***************************************************************************************************************************************************************
50ok: [localhost] => (item=192.168.45.46) => {
51 "msg": "192.168.45.46"
52}
53ok: [localhost] => (item=192.168.128.123) => {
54 "msg": "192.168.128.123"
55}
56
57TASK [template] *************************************************************************************************************************************************************
58ok: [localhost -> localhost]
59
60TASK [Show OUTPUT file] *****************************************************************************************************************************************************
61ok: [localhost] => {
62 "msg": "---\nYES: ['192.168.45.46', '192.168.128.123']"
63}
64
65PLAY RECAP ******************************************************************************************************************************************************************
66localhost : ok=5 changed=0 unreachable=1 failed=0 skipped=2 rescued=0 ignored=0