thinkcenter-update: add dpkg/apt self-heal step (prevents half-configured-package cascade failures)
This commit is contained in:
parent
a08788e3df
commit
590d778e5a
@ -70,6 +70,14 @@
|
|||||||
that: inventory_hostname == 'thinkcenter'
|
that: inventory_hostname == 'thinkcenter'
|
||||||
fail_msg: "Refusing to run — this play is scoped to thinkcenter only."
|
fail_msg: "Refusing to run — this play is scoped to thinkcenter only."
|
||||||
|
|
||||||
|
- name: "[selfheal] Repair any half-configured dpkg/apt state (prevents cascade failures)"
|
||||||
|
ansible.builtin.shell: |
|
||||||
|
dpkg --configure -a || true
|
||||||
|
apt-get -y -f install || true
|
||||||
|
register: dpkg_selfheal
|
||||||
|
changed_when: "'Setting up' in (dpkg_selfheal.stdout | default(''))"
|
||||||
|
failed_when: false
|
||||||
|
|
||||||
- name: "[apt] Update cache + full dist-upgrade"
|
- name: "[apt] Update cache + full dist-upgrade"
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
update_cache: true
|
update_cache: true
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user