fix: tolerate completed cloud-init package errors
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user