cancel
Showing results for 
Search instead for 
Did you mean: 
linuxss
Mission Specialist
Mission Specialist
  • 2,422 Views

Ansible - multiple plays

Jump to solution
Quick question folks  - if one or all hosts in the first play has errors then should the second play in the same playbook run for the same hosts... Not sure what is the correct or expected result for these scenarios.
 
Thanks.
 
Labels (2)
Tags (1)
0 Kudos
2 Solutions

Accepted Solutions
Alexandre
Starfighter Starfighter
Starfighter
  • 2,401 Views

Hi

Simple answer: Ansible evaluates the return code of each task to determine whether the task succeeded or failed. Normally, when a task fails Ansible immediately aborts the rest of the play on that host, skipping all subsequent tasks.

More detail, look, please: https://docs.ansible.com/ansible/2.8/user_guide/playbooks_error_handling.html

View solution in original post

0 Kudos
linuxss
Mission Specialist
Mission Specialist
  • 2,346 Views

Thank you!.


@linuxss wrote:
Quick question folks  - if one or all hosts in the first play has errors then should the second play in the same playbook run for the same hosts... Not sure what is the correct or expected result for these scenarios.
 
Thanks.
 


I presume it would try the play for the (i) next host or the (ii) next play in the same playbook for another host...

View solution in original post

0 Kudos
3 Replies
Alexandre
Starfighter Starfighter
Starfighter
  • 2,402 Views

Hi

Simple answer: Ansible evaluates the return code of each task to determine whether the task succeeded or failed. Normally, when a task fails Ansible immediately aborts the rest of the play on that host, skipping all subsequent tasks.

More detail, look, please: https://docs.ansible.com/ansible/2.8/user_guide/playbooks_error_handling.html

0 Kudos
linuxss
Mission Specialist
Mission Specialist
  • 1,962 Views

in the exam environment - what would be the best way to copy paste between windows and for opening new terminals....?  Ctrl + Shift + T ?

0 Kudos
linuxss
Mission Specialist
Mission Specialist
  • 2,347 Views

Thank you!.


@linuxss wrote:
Quick question folks  - if one or all hosts in the first play has errors then should the second play in the same playbook run for the same hosts... Not sure what is the correct or expected result for these scenarios.
 
Thanks.
 


I presume it would try the play for the (i) next host or the (ii) next play in the same playbook for another host...

0 Kudos
Join the discussion
You must log in to join this conversation.