I have following ansible role tasks: "Task 1", "Task 2", "Task 2.1", "Task 2.2", "Task 3"
I need run them, but all these tasks need a lot of time to complete (from 1 hour to 12 hours) and they must go in special sort order (I mean, that "Task 2.1" must start only after "Task 2" and so on)
How can I do this?
Best Answer
For a long running task use Ansible's Asynchronous mode to effectively background the task.
Then follow it up with another task that checks the status of the backgrounded task.
Example taken from Ansible official docs: http://docs.ansible.com/ansible/playbooks_async.html