From 3de6b268ec01ed4afa243fc3522f404e88834fd8 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 9 Aug 2023 22:23:27 +0200 Subject: cloud_init_wait: wait for SSH connection first --- roles/cloud_init_wait/tasks/main.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/roles/cloud_init_wait/tasks/main.yml b/roles/cloud_init_wait/tasks/main.yml index 5de51eb..c7ed595 100644 --- a/roles/cloud_init_wait/tasks/main.yml +++ b/roles/cloud_init_wait/tasks/main.yml @@ -1,3 +1,11 @@ +# Make a playbook usable immediately after creating a VM - even before +# the SSH server is started. +- name: Wait for SSH connection + ansible.builtin.wait_for_connection: + timeout: '{{ cloud_init_wait_seconds }}' + +# Again, make a playbook usable immediately after creating a VM - that includes +# waiting until cloud-init is done. - name: Wait until cloud-init is finished ansible.builtin.stat: path: '{{ cloud_init_wait_path }}' -- cgit v1.2.3