I have a use case where there is a dependency of playbooks. I have one set of hosts to start application on all my machines and then another set of hosts which are actual machines.
Now my question is, is it possible for ansible to run the second playbook( lets say to update a package) only when the first playbook is successfully executed and application started. The problem I am having here is that, the second playbook runs though the first one is not successful and application didn't start
Here I start application from a remote machine that has permission to all my machines and update package needs to be done on each machine. Hence they are two different playbooks which rely on each other.
First playbook
hosts: A
tasks:
- name: check if app started and ready
command: x
Second Playbook
hosts: B
tasks:
- name: run y command from B machine to execute on A
command: y
Here the problem is second playbook doesn't care if command X is executed or not. As soon as first playbook is done( no matter success or fail, second one starts since they belong to different machines)