Fix Docker service management; relocate Grub fsck

This commit is contained in:
2024-07-31 11:53:25 -04:00
parent 0b11597038
commit e53e97cf9a
5 changed files with 52 additions and 23 deletions

View File

@ -13,25 +13,8 @@
when:
- bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | default(false) | bool
block:
- name: Enable Grub filesystem check
ansible.builtin.import_role:
name: autofsck
tasks_from: main.yml
- name: Flush handlers
ansible.builtin.meta: flush_handlers
# Make sure to update the reboot code for the WF environment
- name: Reboot to run filesystem checks
ansible.builtin.reboot:
- name: Disable Grub filesystem check
ansible.builtin.import_role:
name: autofsck
tasks_from: cleanup.yml
- name: Flush handlers
ansible.builtin.meta: flush_handlers
- name: Perform filesystem check prior to Bigboot execution
ansible.builtin.import_tasks: tasks/grub_filesystem_check.yml
- name: Check for and disable services exceeding the timeout threshold
ansible.builtin.import_tasks: tasks/check_systemd_services.yml
@ -45,9 +28,6 @@
- bigboot_systemd_disabled_services is defined
- bigboot_systemd_disabled_services | length > 0
- name: Stop Docker service if present and running
ansible.builtin.import_tasks: tasks/stop_docker_service.yml
- name: Extend the timeout values for physical hosts
ansible.builtin.set_fact:
@ -74,6 +54,14 @@
when:
- bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | bool
- name: Restore Docker service to its pre-Bigboot state
ansible.builtin.service:
name: "{{ bigboot_docker_service }}"
state: "{{ bigboot_data[inventory_hostname]['bigboot_docker_running'] }}"
enabled: "{{ bigboot_data[inventory_hostname]['bigboot_docker_enabled'] }}"
when:
- ansible_facts['services'][bigboot_docker_service] is defined
- name: Re-enabling services previously disabled
ansible.builtin.service:
name: "{{ item }}"