I have an ansible playbook which looks roughly like this
- hosts: firstNode tasks: - name: create cluster shell: "cluster create command" - hosts: otherNodes serial: 1 tasks: - name: joining cluster shell: "cluster join command"
'firstNode' is always a single host while 'otherNodes' could be any number. It's important that each command is executed in serial. I would now like to insert a job before and after each join command to ensure that everything is working so for a 3 node cluster the sequence would be the following jobs in serial
host 1 - create cluster host 2 - check cluster status host 2 - join cluster host 2 - check node status host 3 - check cluster status host 3 - join cluster host 3 - check node status
Is this possible with ansible?