Increase timeout of SSH command in Ansible
You're going to want to run the task asynchronously. High-level steps would be:
- send deployment request for instance
- get some kind of instance or request id for said request
- poll for result of request
- continue playbook
here's an example of this behaviour from the official docs
- name: 'YUM - fire and forget task'
yum:
name: docker-io
state: installed
async: 1000
poll: 0
register: yum_sleeper
- name: 'YUM - check on fire and forget task'
async_status:
jid: "{{ yum_sleeper.ansible_job_id }}"
register: job_result
until: job_result.finished
retries: 30
delay: 10