Move to using verified_reboot to manage reboots for Bigboot; infra.lvm_snapshots is local for testing this

This commit is contained in:
2024-11-07 17:28:03 -05:00
parent e4245dfb58
commit 6c69d48268
69 changed files with 3251 additions and 37 deletions

View File

@ -2,34 +2,34 @@
- name: Ensure service facts are available
ansible.builtin.service_facts:
- name: Capture a list of running services
ansible.builtin.set_fact:
bigboot_systemd_running_services:
"{{ bigboot_systemd_running_services | default([]) + [item['key']] }}"
loop: "{{ ansible_facts['services'] | dict2items }}"
loop_control:
label: "{{ item['key'] }}"
when:
- "'running' in item['value']['state']"
# - name: Capture a list of running services
# ansible.builtin.set_fact:
# bigboot_systemd_running_services:
# "{{ bigboot_systemd_running_services | default([]) + [item['key']] }}"
# loop: "{{ ansible_facts['services'] | dict2items }}"
# loop_control:
# label: "{{ item['key'] }}"
# when:
# - "'running' in item['value']['state']"
- name: Get the stop timeout value for running services
ansible.builtin.shell:
cmd: |
set -o pipefail
systemctl show {{ item }} | grep TimeoutStopUSec
changed_when: false
register: bigboot_systemd_service_timeout
loop: "{{ bigboot_systemd_running_services }}"
# - name: Get the stop timeout value for running services
# ansible.builtin.shell:
# cmd: |
# set -o pipefail
# systemctl show {{ item }} | grep TimeoutStopUSec
# changed_when: false
# register: bigboot_systemd_service_timeout
# loop: "{{ bigboot_systemd_running_services }}"
- name: Adding services exceeding the timeout threshold to the list of services to disable
ansible.builtin.set_fact:
bigboot_services_disabled: "{{ bigboot_services_disabled | default([]) + [item['item']] }}"
loop: "{{ bigboot_systemd_service_timeout['results'] }}"
loop_control:
label: "{{ item['item'] }}"
when:
- item['item'] not in bigboot_protected_services
- item['stdout'] | regex_replace('^.*=(.*$)', '\\1') | community.general.to_minutes >= bigboot_service_max_timeout | int
# - name: Adding services exceeding the timeout threshold to the list of services to disable
# ansible.builtin.set_fact:
# bigboot_services_disabled: "{{ bigboot_services_disabled | default([]) + [item['item']] }}"
# loop: "{{ bigboot_systemd_service_timeout['results'] }}"
# loop_control:
# label: "{{ item['item'] }}"
# when:
# - item['item'] not in bigboot_protected_services
# - item['stdout'] | regex_replace('^.*=(.*$)', '\\1') | community.general.to_minutes >= bigboot_service_max_timeout | int
- name: Adding incompatible services to the list of services to disable
ansible.builtin.set_fact:

View File

@ -11,15 +11,19 @@
# - name: Reboot to run filesystem checks
# ansible.builtin.reboot:
- name: Reboot to run filesystem checks
ansible.builtin.command: /sbin/shutdown -r +1
# - name: Reboot to run filesystem checks
# ansible.builtin.command: /sbin/shutdown -r +1
- name: Wait for the reboot to complete
ansible.builtin.wait_for_connection:
connect_timeout: 20
sleep: 10
delay: "{{ bigboot_post_reboot_delay | default('70') }}"
timeout: "{{ bigboot_reboot_timeout | default('1800') }}"
# - name: Wait for the reboot to complete
# ansible.builtin.wait_for_connection:
# connect_timeout: 20
# sleep: 10
# delay: "{{ bigboot_post_reboot_delay | default('70') }}"
# timeout: "{{ bigboot_reboot_timeout | default('1800') }}"
- name: Reboot host to run filesystem checks
ansible.builtin.import_role:
name: verified_reboot
- name: Disable Grub filesystem check
ansible.builtin.import_role: