fix: accept cloud-init exit code 2 after first boot
Deploy Cluster / Terraform (push) Successful in 28s
Deploy Cluster / Ansible (push) Failing after 6m2s

Ubuntu cloud-init returns exit code 2 for some completed boots even when the
status output is 'done'. Treat that as a successful wait state so Ansible can
continue into the package install phase instead of aborting early.
This commit is contained in:
2026-04-22 03:40:55 +00:00
parent 9a2d213114
commit 06366ee5e6
+7
View File
@@ -7,7 +7,14 @@
- name: Wait for cloud-init to finish first-boot tasks
command: cloud-init status --wait
register: cloud_init_wait
changed_when: false
failed_when: >-
cloud_init_wait.rc not in [0, 2] or
(
'status: done' not in cloud_init_wait.stdout and
'status: disabled' not in cloud_init_wait.stdout
)
when: cloud_init_binary.rc == 0
- name: Update apt cache