diff --git a/deploy/aws/provision/main.yml b/deploy/aws/provision/main.yml index 15f614f95..2d42e9f14 100644 --- a/deploy/aws/provision/main.yml +++ b/deploy/aws/provision/main.yml @@ -26,11 +26,25 @@ - hosts: all remote_user: ec2-user - become: true + gather_facts: false tasks: - - name: Wait 300 seconds for port 22 to become open and contain "OpenSSH" + - set_fact: + host_to_wait_for: "{{ ansible_ssh_host | default(inventory_hostname) }}" + - name: waiting for server to be alive wait_for: + state: started port: 22 + host: "{{ host_to_wait_for }}" + delay: 10 + timeout: 300 + connect_timeout: 300 + search_regex: OpenSSH + delegate_to: localhost + +- hosts: all + remote_user: ec2-user + become: true + tasks: - name: Gather facts setup: