aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-08-09 18:15:52 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-08-09 18:23:16 +0200
commitc7c594671a75a9e846818433edcd09deadb92698 (patch)
tree432f896077a7dc9545434e50c3ad2b849005bd93
parentv0.0.6 (diff)
downloadinfra-ansible-c7c594671a75a9e846818433edcd09deadb92698.tar.gz
infra-ansible-c7c594671a75a9e846818433edcd09deadb92698.zip
add cloud_init_wait role
-rw-r--r--roles/cloud_init_wait/tasks/main.yml12
1 files changed, 12 insertions, 0 deletions
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