From c7c594671a75a9e846818433edcd09deadb92698 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 9 Aug 2023 18:15:52 +0200 Subject: add cloud_init_wait role --- roles/cloud_init_wait/tasks/main.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 roles/cloud_init_wait/tasks/main.yml (limited to 'roles') diff --git a/roles/cloud_init_wait/tasks/main.yml b/roles/cloud_init_wait/tasks/main.yml new file mode 100644 index 0000000..4a69f60 --- /dev/null +++ b/roles/cloud_init_wait/tasks/main.yml @@ -0,0 +1,12 @@ +- name: Wait until cloud-init is finished + ansible.builtin.stat: + path: /var/lib/cloud/instance/boot-finished + # WTF? Is this the best way to _just_ check if a file exists? + get_attributes: false + get_checksum: false + get_mime: false + register: boot_finished + until: boot_finished.stat.exists is not false + # About 5 minutes worth of attempts. + retries: 30 + delay: 10 -- cgit v1.2.3