fix: tolerate completed cloud-init package errors
Deploy Cluster / Terraform (push) Successful in 32s
Deploy Cluster / Ansible (push) Failing after 37m53s

This commit is contained in:
2026-05-03 00:36:42 +00:00
parent 1896108cbb
commit 600aa4787d
+12 -1
View File
@@ -10,13 +10,24 @@
register: cloud_init_wait
changed_when: false
failed_when: >-
cloud_init_wait.rc not in [0, 2] or
cloud_init_wait.rc not in [0, 1, 2] or
(
'status: done' not in cloud_init_wait.stdout and
'status: error' not in cloud_init_wait.stdout and
'status: disabled' not in cloud_init_wait.stdout
)
when: cloud_init_binary.rc == 0
- name: Report non-blocking cloud-init error status
debug:
msg: |
cloud-init completed with status error on {{ inventory_hostname }}; continuing because SSH is reachable and Ansible owns package setup.
{{ cloud_init_wait.stdout | default('') }}
{{ cloud_init_wait.stderr | default('') }}
when:
- cloud_init_binary.rc == 0
- cloud_init_wait.rc == 1 or 'status: error' in (cloud_init_wait.stdout | default(''))
- name: Persist primary interface MTU for registry egress
copy:
dest: /etc/netplan/99-k8s-mtu.yaml