Compare commits

...

4 Commits

Author SHA1 Message Date
677287fd2e Add additional wait after stopping OSDs
Allows the Ceph cluster to properly reconcile first.
2023-10-24 10:42:15 -04:00
17f819ea3f Don't set "latest" for libvirt packages
Avoids errors during runs before upgrades.
2023-10-24 10:41:47 -04:00
d0bcbf123f Move kernel cleanup to after reboot
Otherwise, modules might fail etc. when the kernel package is purged
before reboot causing odd failures.
2023-10-24 10:41:47 -04:00
7fe682aa60 Handle freshness for all 3 types separately
If microcode was missing, checking the other two would be UNKN and thus
not restart. But, if microcode *is* present, we want to restart for
either of the other two as well.

So separate into 3 distinct checks and restart if any one is changed.
2023-10-24 10:41:47 -04:00
2 changed files with 30 additions and 12 deletions

View File

@ -35,12 +35,6 @@
autoclean: yes
upgrade: full
- name: clean up obsolete kernels
command: /usr/local/sbin/kernel-cleanup.sh
- name: clean up obsolete packages
command: /usr/local/sbin/dpkg-cleanup.sh
- name: clean apt archives
file:
dest: /var/cache/apt/archives
@ -59,10 +53,22 @@
gather_facts: yes
serial: 1
tasks:
- name: check freshness
command: /usr/sbin/needrestart -p
register: freshness
changed_when: freshness.rc >= 1 and freshness.rc < 3
- name: check freshness (kernel)
command: /usr/sbin/needrestart -p -k
register: freshness_kernel
changed_when: freshness_kernel.rc >= 1 and freshness_kernel.rc < 3
failed_when: false
- name: check freshness (libraries)
command: /usr/sbin/needrestart -p -l
register: freshness_libraries
changed_when: freshness_libraries.rc >= 1 and freshness_libraries.rc < 3
failed_when: false
- name: check freshness (microcode)
command: /usr/sbin/needrestart -p -w
register: freshness_microcode
changed_when: freshness_microcode.rc >= 1 and freshness_microcode.rc < 3
failed_when: false
- name: restart system cleanly
@ -134,6 +140,12 @@
ignore_errors: true
with_items: "{{ osd_services.stdout_lines }}"
- name: wait 30 seconds for system to stabilize
pause:
seconds: 30
become: no
connection: local
- name: stop Ceph Monitor daemon cleanly
service:
name: "ceph-mon@{{ ansible_hostname }}"
@ -205,7 +217,7 @@
- name: reset any systemd failures
command: systemctl reset-failed
when: freshness.changed
when: freshness_kernel.changed or freshness_libraries.changed or freshness_microcode.changed
- name: wait 30 seconds for system to stabilize
pause:
@ -213,6 +225,12 @@
become: no
connection: local
- name: clean up obsolete kernels
command: /usr/local/sbin/kernel-cleanup.sh
- name: clean up obsolete packages
command: /usr/local/sbin/dpkg-cleanup.sh
- hosts: all
remote_user: deploy
become: yes

View File

@ -9,7 +9,7 @@
- vhostmd
- ceph-common
- libguestfs-tools
state: latest
state: present
register: apt_res
retries: 5
until: apt_res is success