Is it possible to use ansible to manage order of programs? Im trying to find an automated solution which will do the following steps:
- run a program on HostA
- run a command on HostB which requires HostA program to run
- run a program on HostC if 2. step succeed
- run a command on HostD which requires HostC program to run
- run a command on HostE which requires HostC program to run
For example:
---
- hosts: neededhosts
roles:
- startprogram
- runcommand
- startsecprgoram
.
.
.
startprogram:
- name: start hostA program
tasks:
- name: start program
hosts: HostA
shell: /etc/init.d/HostAprogram.sh start
runcommand:
- name: run command on HostB
tasks:
- name: run command
hosts: HostB
shell: command which using host A