I want to include a playbook
in the master playbook. However if anything fails in the include playbooks, master playbook should exit out without running further tasks specified in it.
MasterPlaybook.yml
- include: playbook1.yml
- include: playbook2.yml
- name: copy file
shell: echo "hello"
- name: list other one
shell: echo "Hi"
playbook1.yml
- name: list task
shell: ls /tmp/ | grep text.html
- name: list file
shell: ls /root/ | grep text2.html
playbook2.yml
- name: list task
shell: ls /tmp/ | grep text.html
- name: list file
shell: ls /root/ | grep text2.html
So in the above example if any task fail in playbook1.yml
, the rest of the tasks in master should not get executed