diff --git a/ansible/site.yml b/ansible/site.yml index 8e1bc50..c6663f7 100644 --- a/ansible/site.yml +++ b/ansible/site.yml @@ -21,6 +21,23 @@ - name: Gather facts after SSH is reachable setup: + register: initial_setup + ignore_errors: true + ignore_unreachable: true + + - name: Clear transient SSH unreachable state after first fact gather + meta: clear_host_errors + when: initial_setup.unreachable | default(false) + + - name: Wait for SSH after transient first-boot disconnect + wait_for_connection: + delay: 10 + timeout: 300 + when: initial_setup.unreachable | default(false) or initial_setup.failed | default(false) + + - name: Gather facts after transient first-boot disconnect + setup: + when: initial_setup.unreachable | default(false) or initial_setup.failed | default(false) roles: - common