Last active
January 12, 2021 14:01
-
-
Save ajalab/254a1e866b5d92ef1815650414a13c81 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[foo] | |
foo1 fail=False | |
foo2 fail=True | |
foo3 fail=False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PLAY [all] ********************************************************************* | |
TASK [Print ansible_play_batch (before failure)] ******************************* | |
ok: [foo1] => { | |
"ansible_play_batch": [ | |
"foo1", | |
"foo2" | |
] | |
} | |
ok: [foo2] => { | |
"ansible_play_batch": [ | |
"foo1", | |
"foo2" | |
] | |
} | |
TASK [Print ansible_play_hosts (before failure)] ******************************* | |
ok: [foo1] => { | |
"ansible_play_hosts": [ | |
"foo1", | |
"foo2", | |
"foo3" | |
] | |
} | |
ok: [foo2] => { | |
"ansible_play_hosts": [ | |
"foo1", | |
"foo2", | |
"foo3" | |
] | |
} | |
TASK [Print ansible_play_hosts_all (before failure)] *************************** | |
ok: [foo1] => { | |
"ansible_play_hosts_all": [ | |
"foo1", | |
"foo2", | |
"foo3" | |
] | |
} | |
ok: [foo2] => { | |
"ansible_play_hosts_all": [ | |
"foo1", | |
"foo2", | |
"foo3" | |
] | |
} | |
TASK [Simulate failure] ******************************************************** | |
skipping: [foo1] | |
fatal: [foo2]: FAILED! => {"changed": false, "msg": "fail!"} | |
TASK [Print ansible_play_batch (after failure)] ******************************** | |
ok: [foo1] => { | |
"ansible_play_batch": [ | |
"foo1" | |
] | |
} | |
TASK [Print ansible_play_hosts (after failure)] ******************************** | |
ok: [foo1] => { | |
"ansible_play_hosts": [ | |
"foo1", | |
"foo3" | |
] | |
} | |
TASK [Print ansible_play_hosts_all (after failure)] **************************** | |
ok: [foo1] => { | |
"ansible_play_hosts_all": [ | |
"foo1", | |
"foo2", | |
"foo3" | |
] | |
} | |
PLAY [all] ********************************************************************* | |
TASK [Print ansible_play_batch (before failure)] ******************************* | |
ok: [foo3] => { | |
"ansible_play_batch": [ | |
"foo3" | |
] | |
} | |
TASK [Print ansible_play_hosts (before failure)] ******************************* | |
ok: [foo3] => { | |
"ansible_play_hosts": [ | |
"foo1", | |
"foo3" | |
] | |
} | |
TASK [Print ansible_play_hosts_all (before failure)] *************************** | |
ok: [foo3] => { | |
"ansible_play_hosts_all": [ | |
"foo1", | |
"foo2", | |
"foo3" | |
] | |
} | |
TASK [Simulate failure] ******************************************************** | |
skipping: [foo3] | |
TASK [Print ansible_play_batch (after failure)] ******************************** | |
ok: [foo3] => { | |
"ansible_play_batch": [ | |
"foo3" | |
] | |
} | |
TASK [Print ansible_play_hosts (after failure)] ******************************** | |
ok: [foo3] => { | |
"ansible_play_hosts": [ | |
"foo1", | |
"foo3" | |
] | |
} | |
TASK [Print ansible_play_hosts_all (after failure)] **************************** | |
ok: [foo3] => { | |
"ansible_play_hosts_all": [ | |
"foo1", | |
"foo2", | |
"foo3" | |
] | |
} | |
PLAY RECAP ********************************************************************* | |
foo1 : ok=6 changed=0 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 | |
foo2 : ok=3 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 | |
foo3 : ok=6 changed=0 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: all | |
gather_facts: no | |
serial: 2 | |
tasks: | |
- name: Print ansible_play_batch (before failure) | |
debug: | |
var: ansible_play_batch | |
- name: Print ansible_play_hosts (before failure) | |
debug: | |
var: ansible_play_hosts | |
- name: Print ansible_play_hosts_all (before failure) | |
debug: | |
var: ansible_play_hosts_all | |
- name: Simulate failure | |
fail: | |
msg: "fail!" | |
when: fail | |
- name: Print ansible_play_batch (after failure) | |
debug: | |
var: ansible_play_batch | |
- name: Print ansible_play_hosts (after failure) | |
debug: | |
var: ansible_play_hosts | |
- name: Print ansible_play_hosts_all (after failure) | |
debug: | |
var: ansible_play_hosts_all | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PLAY [all] ********************************************************************* | |
TASK [Print ansible_play_batch (before getting unreachable)] ******************* | |
ok: [foo1] => { | |
"ansible_play_batch": [ | |
"foo1", | |
"foo2" | |
] | |
} | |
ok: [foo2] => { | |
"ansible_play_batch": [ | |
"foo1", | |
"foo2" | |
] | |
} | |
TASK [Print ansible_play_hosts (before getting unreachable)] ******************* | |
ok: [foo1] => { | |
"ansible_play_hosts": [ | |
"foo1", | |
"foo2", | |
"foo3" | |
] | |
} | |
ok: [foo2] => { | |
"ansible_play_hosts": [ | |
"foo1", | |
"foo2", | |
"foo3" | |
] | |
} | |
TASK [Print ansible_play_hosts_all (before getting unreachable)] *************** | |
ok: [foo1] => { | |
"ansible_play_hosts_all": [ | |
"foo1", | |
"foo2", | |
"foo3" | |
] | |
} | |
ok: [foo2] => { | |
"ansible_play_hosts_all": [ | |
"foo1", | |
"foo2", | |
"foo3" | |
] | |
} | |
TASK [Simulate unreachability] ************************************************* | |
skipping: [foo1] | |
fatal: [foo2]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ssh: Could not resolve hostname foo2: nodename nor servname provided, or not known", "unreachable": true} | |
TASK [Print ansible_play_batch (after getting unreachable)] ******************** | |
ok: [foo1] => { | |
"ansible_play_batch": [ | |
"foo1" | |
] | |
} | |
TASK [Print ansible_play_hosts (after getting unreachable)] ******************** | |
ok: [foo1] => { | |
"ansible_play_hosts": [ | |
"foo1", | |
"foo3" | |
] | |
} | |
TASK [Print ansible_play_hosts_all (after getting unreachable)] **************** | |
ok: [foo1] => { | |
"ansible_play_hosts_all": [ | |
"foo1", | |
"foo2", | |
"foo3" | |
] | |
} | |
PLAY [all] ********************************************************************* | |
TASK [Print ansible_play_batch (before getting unreachable)] ******************* | |
ok: [foo3] => { | |
"ansible_play_batch": [ | |
"foo3" | |
] | |
} | |
TASK [Print ansible_play_hosts (before getting unreachable)] ******************* | |
ok: [foo3] => { | |
"ansible_play_hosts": [ | |
"foo1", | |
"foo2", | |
"foo3" | |
] | |
} | |
TASK [Print ansible_play_hosts_all (before getting unreachable)] *************** | |
ok: [foo3] => { | |
"ansible_play_hosts_all": [ | |
"foo1", | |
"foo2", | |
"foo3" | |
] | |
} | |
TASK [Simulate unreachability] ************************************************* | |
skipping: [foo3] | |
TASK [Print ansible_play_batch (after getting unreachable)] ******************** | |
ok: [foo3] => { | |
"ansible_play_batch": [ | |
"foo3" | |
] | |
} | |
TASK [Print ansible_play_hosts (after getting unreachable)] ******************** | |
ok: [foo3] => { | |
"ansible_play_hosts": [ | |
"foo1", | |
"foo2", | |
"foo3" | |
] | |
} | |
TASK [Print ansible_play_hosts_all (after getting unreachable)] **************** | |
ok: [foo3] => { | |
"ansible_play_hosts_all": [ | |
"foo1", | |
"foo2", | |
"foo3" | |
] | |
} | |
PLAY RECAP ********************************************************************* | |
foo1 : ok=6 changed=0 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 | |
foo2 : ok=3 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0 | |
foo3 : ok=6 changed=0 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: all | |
gather_facts: no | |
serial: 2 | |
tasks: | |
- name: Print ansible_play_batch (before getting unreachable) | |
debug: | |
var: ansible_play_batch | |
- name: Print ansible_play_hosts (before getting unreachable) | |
debug: | |
var: ansible_play_hosts | |
- name: Print ansible_play_hosts_all (before getting unreachable) | |
debug: | |
var: ansible_play_hosts_all | |
- name: Simulate unreachability | |
command: /bin/true | |
when: fail | |
- name: Print ansible_play_batch (after getting unreachable) | |
debug: | |
var: ansible_play_batch | |
- name: Print ansible_play_hosts (after getting unreachable) | |
debug: | |
var: ansible_play_hosts | |
- name: Print ansible_play_hosts_all (after getting unreachable) | |
debug: | |
var: ansible_play_hosts_all | |
Author
ajalab
commented
Jan 12, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment