From 22d10c2934881a64b03f58d6f5f52c694b5a3c23 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Fri, 12 Jul 2024 09:55:31 -0400 Subject: [PATCH 01/27] task re-order and re-name --- bigboot_execute_resize.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bigboot_execute_resize.yml b/bigboot_execute_resize.yml index 2055593..eb36994 100644 --- a/bigboot_execute_resize.yml +++ b/bigboot_execute_resize.yml @@ -9,10 +9,13 @@ - bigboot_vars.yml tasks: - - name: Perform filesystem check prior to Bigboot execution + - name: Perform service and filesystem checks prior to Bigboot execution when: - (bigboot_execute_shrink_lv | bool or bigboot_execute_bigboot | bool) block: + - name: Check for and disable services exceeding the timeout threshold + ansible.builtin.import_tasks: tasks/check_systemd_services.yml + - name: Enable Grub filesystem check ansible.builtin.import_role: name: autofsck @@ -33,9 +36,6 @@ - name: Flush handlers ansible.builtin.meta: flush_handlers - - name: Check for and disable services exceeding the timeout threshold - ansible.builtin.import_tasks: tasks/check_systemd_services.yml - - name: Extend the timeout values for physical hosts ansible.builtin.set_fact: From b42b725c3534775deb850e42e4f3d5a152f45b3f Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Fri, 12 Jul 2024 15:03:31 -0400 Subject: [PATCH 02/27] remove filesystem checks for now --- bigboot-noop.yml | 26 +++++++++++++------------- bigboot_execute_resize.yml | 22 +++++++++++----------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/bigboot-noop.yml b/bigboot-noop.yml index 6507a2e..e33fd4d 100644 --- a/bigboot-noop.yml +++ b/bigboot-noop.yml @@ -36,10 +36,13 @@ - bigboot_vars.yml tasks: - - name: Perform filesystem check prior to Bigboot execution + - name: Perform service and filesystem checks prior to Bigboot execution when: - (bigboot_execute_shrink_lv | bool or bigboot_execute_bigboot | bool) block: + # - name: Check for and disable services exceeding the timeout threshold + # ansible.builtin.import_tasks: tasks/check_systemd_services.yml + - name: Enable Grub filesystem check ansible.builtin.import_role: name: autofsck @@ -60,9 +63,6 @@ - name: Flush handlers ansible.builtin.meta: flush_handlers - - name: Check for and disable services exceeding the timeout threshold - ansible.builtin.import_tasks: tasks/check_systemd_services.yml - - name: Extend the timeout values for physical hosts ansible.builtin.set_fact: @@ -85,12 +85,12 @@ when: - bigboot_execute_bigboot | bool - - name: Re-enabling services previously disabled - ansible.builtin.service: - name: "{{ item }}" - state: started - enabled: true - loop: "{{ bigboot_systemd_disabled_services }}" - when: - - bigboot_systemd_disabled_services is defined - - bigboot_systemd_disabled_services | length > 0 + # - name: Re-enabling services previously disabled + # ansible.builtin.service: + # name: "{{ item }}" + # state: started + # enabled: true + # loop: "{{ bigboot_systemd_disabled_services }}" + # when: + # - bigboot_systemd_disabled_services is defined + # - bigboot_systemd_disabled_services | length > 0 diff --git a/bigboot_execute_resize.yml b/bigboot_execute_resize.yml index eb36994..e254548 100644 --- a/bigboot_execute_resize.yml +++ b/bigboot_execute_resize.yml @@ -13,8 +13,8 @@ when: - (bigboot_execute_shrink_lv | bool or bigboot_execute_bigboot | bool) block: - - name: Check for and disable services exceeding the timeout threshold - ansible.builtin.import_tasks: tasks/check_systemd_services.yml + # - name: Check for and disable services exceeding the timeout threshold + # ansible.builtin.import_tasks: tasks/check_systemd_services.yml - name: Enable Grub filesystem check ansible.builtin.import_role: @@ -60,12 +60,12 @@ when: - bigboot_execute_bigboot | bool - - name: Re-enabling services previously disabled - ansible.builtin.service: - name: "{{ item }}" - state: started - enabled: true - loop: "{{ bigboot_systemd_disabled_services }}" - when: - - bigboot_systemd_disabled_services is defined - - bigboot_systemd_disabled_services | length > 0 + # - name: Re-enabling services previously disabled + # ansible.builtin.service: + # name: "{{ item }}" + # state: started + # enabled: true + # loop: "{{ bigboot_systemd_disabled_services }}" + # when: + # - bigboot_systemd_disabled_services is defined + # - bigboot_systemd_disabled_services | length > 0 From c34ecde4850ec60b20af8d1c66d133e691aa001a Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Wed, 17 Jul 2024 18:22:49 -0400 Subject: [PATCH 03/27] Fix to allow per-host Bigboot executions --- bigboot_execute_resize.yml | 7 ++++--- bigboot_rear_backup.yml | 4 ++-- bigboot_setup_environment.yml | 20 ++++++++++++-------- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/bigboot_execute_resize.yml b/bigboot_execute_resize.yml index e254548..18f5d02 100644 --- a/bigboot_execute_resize.yml +++ b/bigboot_execute_resize.yml @@ -11,7 +11,8 @@ tasks: - name: Perform service and filesystem checks prior to Bigboot execution when: - - (bigboot_execute_shrink_lv | bool or bigboot_execute_bigboot | bool) + - (bigboot_data[inventory_hostname]['bigboot_execute_shrink_lv'] | bool + or bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | bool) block: # - name: Check for and disable services exceeding the timeout threshold # ansible.builtin.import_tasks: tasks/check_systemd_services.yml @@ -52,13 +53,13 @@ - device: "{{ bigboot_adjacent_lvm_device }}" size: "{{ bigboot_lv_shrink_size | int }}" when: - - bigboot_execute_shrink_lv | bool + - bigboot_data[inventory_hostname]['bigboot_execute_shrink_lv'] | bool - name: Expand the /boot partition as requested ansible.builtin.import_role: name: infra.lvm_snapshots.bigboot when: - - bigboot_execute_bigboot | bool + - bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | bool # - name: Re-enabling services previously disabled # ansible.builtin.service: diff --git a/bigboot_rear_backup.yml b/bigboot_rear_backup.yml index ffde0d6..7d28ea1 100644 --- a/bigboot_rear_backup.yml +++ b/bigboot_rear_backup.yml @@ -2,5 +2,5 @@ - name: Perform a ReaR backup if any disk modifications are to be made ansible.builtin.import_playbook: rhc.rear.rear_backup when: - - bigboot_execute_bigboot | default('false') | bool - - not bigboot_skip_rear_backup | default('true') | bool + - bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | default('false') | bool + - not bigboot_data[inventory_hostname]['bigboot_skip_rear_backup'] | default('true') | bool diff --git a/bigboot_setup_environment.yml b/bigboot_setup_environment.yml index bd7dd06..69bea32 100644 --- a/bigboot_setup_environment.yml +++ b/bigboot_setup_environment.yml @@ -21,13 +21,17 @@ - name: Set environment for subsequent workflow nodes ansible.builtin.set_stats: data: - bigboot_execute_bigboot: "{{ bigboot_execute_bigboot }}" - bigboot_execute_shrink_lv: "{{ bigboot_execute_shrink_lv }}" - bigboot_adjacent_lvm_device: "{{ bigboot_adjacent_lvm_device }}" - bigboot_lv_shrink_size: "{{ bigboot_lv_shrink_size | int }}" - bigboot_size: "{{ bigboot_size }}" - bigboot_skip_rear_backup: "{{ bigboot_skip_rear | default('false') }}" - per_host: false - aggregate: false + bigboot_data: "{{ bigboot_data | default({}) | + combine({inventory_hostname: + { + 'bigboot_execute_bigboot': bigboot_execute_bigboot, + 'bigboot_execute_shrink_lv': bigboot_execute_shrink_lv, + 'bigboot_adjacent_lvm_device': bigboot_adjacent_lvm_device, + 'bigboot_lv_shrink_size': bigboot_lv_shrink_size | int, + 'bigboot_size': bigboot_size, + 'bigboot_skip_rear_backup': bigboot_skip_rear, + 'bigboot_skip_rear_backup': bigboot_skip_rear | default('false') + } + })}}" ... From d26ca163a6669f2a223955f432f7b7d73a30fd75 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Wed, 17 Jul 2024 18:23:49 -0400 Subject: [PATCH 04/27] Fix to allow per-host Bigboot executions; revised --- bigboot_execute_resize.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bigboot_execute_resize.yml b/bigboot_execute_resize.yml index 18f5d02..3807fad 100644 --- a/bigboot_execute_resize.yml +++ b/bigboot_execute_resize.yml @@ -50,8 +50,8 @@ name: infra.lvm_snapshots.shrink_lv vars: shrink_lv_devices: - - device: "{{ bigboot_adjacent_lvm_device }}" - size: "{{ bigboot_lv_shrink_size | int }}" + - device: "{{ bigboot_data[inventory_hostname]['bigboot_adjacent_lvm_device'] }}" + size: "{{ bigboot_data[inventory_hostname]['bigboot_lv_shrink_size'] | int }}" when: - bigboot_data[inventory_hostname]['bigboot_execute_shrink_lv'] | bool From 9567293eb82173e90fb09f6f03db94eb599f46c4 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Wed, 17 Jul 2024 18:40:35 -0400 Subject: [PATCH 05/27] Fix to allow per-host Bigboot executions; revised again --- bigboot_execute_resize.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bigboot_execute_resize.yml b/bigboot_execute_resize.yml index 3807fad..09e35de 100644 --- a/bigboot_execute_resize.yml +++ b/bigboot_execute_resize.yml @@ -58,6 +58,8 @@ - name: Expand the /boot partition as requested ansible.builtin.import_role: name: infra.lvm_snapshots.bigboot + vars: + bigboot_size: "{{ bigboot_data[inventory_hostname]['bigboot_size'] }}" when: - bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | bool From 842ec2bac9379c71ac84952aa35fc85011d64720 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Wed, 17 Jul 2024 18:45:31 -0400 Subject: [PATCH 06/27] Fix to allow per-host Bigboot executions; revised again - indent fix --- bigboot_execute_resize.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bigboot_execute_resize.yml b/bigboot_execute_resize.yml index 09e35de..0277709 100644 --- a/bigboot_execute_resize.yml +++ b/bigboot_execute_resize.yml @@ -58,8 +58,8 @@ - name: Expand the /boot partition as requested ansible.builtin.import_role: name: infra.lvm_snapshots.bigboot - vars: - bigboot_size: "{{ bigboot_data[inventory_hostname]['bigboot_size'] }}" + vars: + bigboot_size: "{{ bigboot_data[inventory_hostname]['bigboot_size'] }}" when: - bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | bool From 438c50a95507128b8de89cd43c2f3e653bc31af7 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Thu, 18 Jul 2024 00:23:12 -0400 Subject: [PATCH 07/27] truncate bigboot-noop.yml for now --- .gitignore | 1 + bigboot-noop.yml | 90 ++++++----------------------------- bigboot_setup_environment.yml | 1 - 3 files changed, 15 insertions(+), 77 deletions(-) diff --git a/.gitignore b/.gitignore index 6be675f..18a4ed6 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ filter_plugins/*.bak python/ collections/ansible_collections roles/autofsck +*.bak diff --git a/bigboot-noop.yml b/bigboot-noop.yml index e33fd4d..8e31f6b 100644 --- a/bigboot-noop.yml +++ b/bigboot-noop.yml @@ -18,79 +18,17 @@ - name: Capture logical volume information ansible.builtin.import_tasks: tasks/capture_lv_device_details.yml - -- name: Perform a ReaR backup if any disk modifications are to be made - ansible.builtin.import_playbook: rhc.rear.rear_backup - when: - - bigboot_execute_bigboot | default('false') | bool - - not bigboot_skip_rear_backup | default('true') | bool - - -- name: Perform logical volume and boot parition resizing as needed - hosts: all - become: true - gather_facts: true - strategy: free - - vars_files: - - bigboot_vars.yml - - tasks: - - name: Perform service and filesystem checks prior to Bigboot execution - when: - - (bigboot_execute_shrink_lv | bool or bigboot_execute_bigboot | bool) - block: - # - name: Check for and disable services exceeding the timeout threshold - # ansible.builtin.import_tasks: tasks/check_systemd_services.yml - - - 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: Extend the timeout values for physical hosts - ansible.builtin.set_fact: - initramfs_post_reboot_delay: 300 - initramfs_reboot_timeout: 14400 - when: - - "'host' in ansible_virtualization_role" - - - name: Shrink the logical volume to support /boot expansion - ansible.builtin.debug: - msg: - - "device: {{ bigboot_adjacent_lvm_device }}" - - "size : {{ bigboot_lv_shrink_size | int }}" - when: - - bigboot_execute_shrink_lv | bool - - - name: Expand the /boot partition as requested - ansible.builtin.debug: - msg: "{{ bigboot_size }}" - when: - - bigboot_execute_bigboot | bool - - # - name: Re-enabling services previously disabled - # ansible.builtin.service: - # name: "{{ item }}" - # state: started - # enabled: true - # loop: "{{ bigboot_systemd_disabled_services }}" - # when: - # - bigboot_systemd_disabled_services is defined - # - bigboot_systemd_disabled_services | length > 0 + - name: Set environment for subsequent workflow nodes + ansible.builtin.set_stats: + data: + bigboot_data: "{{ bigboot_data | default({}) | + combine({inventory_hostname: + { + 'bigboot_execute_bigboot': bigboot_execute_bigboot, + 'bigboot_execute_shrink_lv': bigboot_execute_shrink_lv, + 'bigboot_adjacent_lvm_device': bigboot_adjacent_lvm_device, + 'bigboot_lv_shrink_size': bigboot_lv_shrink_size | int, + 'bigboot_size': bigboot_size, + 'bigboot_skip_rear_backup': bigboot_skip_rear | default('false') + } + })}}" diff --git a/bigboot_setup_environment.yml b/bigboot_setup_environment.yml index 69bea32..320ddb9 100644 --- a/bigboot_setup_environment.yml +++ b/bigboot_setup_environment.yml @@ -29,7 +29,6 @@ 'bigboot_adjacent_lvm_device': bigboot_adjacent_lvm_device, 'bigboot_lv_shrink_size': bigboot_lv_shrink_size | int, 'bigboot_size': bigboot_size, - 'bigboot_skip_rear_backup': bigboot_skip_rear, 'bigboot_skip_rear_backup': bigboot_skip_rear | default('false') } })}}" From 209edd45a4526e383d9e965122a8b8247c9211a5 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Thu, 18 Jul 2024 11:45:04 -0400 Subject: [PATCH 08/27] re-enable service handling; add debug summary of disabled services --- bigboot_execute_resize.yml | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/bigboot_execute_resize.yml b/bigboot_execute_resize.yml index 0277709..1f8ab07 100644 --- a/bigboot_execute_resize.yml +++ b/bigboot_execute_resize.yml @@ -14,8 +14,19 @@ - (bigboot_data[inventory_hostname]['bigboot_execute_shrink_lv'] | bool or bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | bool) block: - # - name: Check for and disable services exceeding the timeout threshold - # ansible.builtin.import_tasks: tasks/check_systemd_services.yml + - name: Check for and disable services exceeding the timeout threshold + ansible.builtin.import_tasks: tasks/check_systemd_services.yml + + - name: Services disabled notice + ansible.builtin.debug: + msg: | + The following services were disabled, and will be re-enabled post + Bigboot execution: + + {{ bigboot_systemd_disabled_services }} + when: + - bigboot_systemd_disabled_services is defined + - bigboot_systemd_disabled_services | length > 0 - name: Enable Grub filesystem check ansible.builtin.import_role: @@ -63,12 +74,12 @@ when: - bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | bool - # - name: Re-enabling services previously disabled - # ansible.builtin.service: - # name: "{{ item }}" - # state: started - # enabled: true - # loop: "{{ bigboot_systemd_disabled_services }}" - # when: - # - bigboot_systemd_disabled_services is defined - # - bigboot_systemd_disabled_services | length > 0 + - name: Re-enabling services previously disabled + ansible.builtin.service: + name: "{{ item }}" + state: started + enabled: true + loop: "{{ bigboot_systemd_disabled_services }}" + when: + - bigboot_systemd_disabled_services is defined + - bigboot_systemd_disabled_services | length > 0 From 549eae7551f670ff9fd63a6a3a71f9d2a1435895 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Thu, 18 Jul 2024 14:15:54 -0400 Subject: [PATCH 09/27] disable docker if found; re-enable post-bigboot --- bigboot_execute_resize.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/bigboot_execute_resize.yml b/bigboot_execute_resize.yml index 1f8ab07..dc649cf 100644 --- a/bigboot_execute_resize.yml +++ b/bigboot_execute_resize.yml @@ -14,6 +14,12 @@ - (bigboot_data[inventory_hostname]['bigboot_execute_shrink_lv'] | bool or bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | bool) block: + - name: Disabling Docker service due to overlay filesystem incompatibility + ansible.builtin.service: + name: docker.service + state: stopped + enabled: false + - name: Check for and disable services exceeding the timeout threshold ansible.builtin.import_tasks: tasks/check_systemd_services.yml @@ -23,7 +29,7 @@ The following services were disabled, and will be re-enabled post Bigboot execution: - {{ bigboot_systemd_disabled_services }} + {{ bigboot_systemd_disabled_services | flatten }} when: - bigboot_systemd_disabled_services is defined - bigboot_systemd_disabled_services | length > 0 @@ -74,6 +80,12 @@ when: - bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | bool + - name: Re-abling Docker service due to overlay filesystem incompatibility + ansible.builtin.service: + name: docker.service + state: stopped + enabled: false + - name: Re-enabling services previously disabled ansible.builtin.service: name: "{{ item }}" From 5c9f42248bad0b4b0ba97cef9e9738a4aeeb4e66 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Thu, 18 Jul 2024 14:19:25 -0400 Subject: [PATCH 10/27] fix for disable docker if found; re-enable post-bigboot --- bigboot_execute_resize.yml | 8 +------- bigboot_setup_environment.yml | 6 ++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bigboot_execute_resize.yml b/bigboot_execute_resize.yml index dc649cf..78a6ae1 100644 --- a/bigboot_execute_resize.yml +++ b/bigboot_execute_resize.yml @@ -14,12 +14,6 @@ - (bigboot_data[inventory_hostname]['bigboot_execute_shrink_lv'] | bool or bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | bool) block: - - name: Disabling Docker service due to overlay filesystem incompatibility - ansible.builtin.service: - name: docker.service - state: stopped - enabled: false - - name: Check for and disable services exceeding the timeout threshold ansible.builtin.import_tasks: tasks/check_systemd_services.yml @@ -80,7 +74,7 @@ when: - bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | bool - - name: Re-abling Docker service due to overlay filesystem incompatibility + - name: Re-enabling Docker service due to overlay filesystem incompatibility ansible.builtin.service: name: docker.service state: stopped diff --git a/bigboot_setup_environment.yml b/bigboot_setup_environment.yml index 320ddb9..53d236d 100644 --- a/bigboot_setup_environment.yml +++ b/bigboot_setup_environment.yml @@ -12,6 +12,12 @@ - name: Cleanup from any previous executions ansible.builtin.import_tasks: tasks/cleanup.yml + - name: Disable Docker service if present due to incompatibility + ansible.builtin.service: + name: docker.service + state: stopped + enabled: false + - name: Capture boot device details ansible.builtin.import_tasks: tasks/capture_boot_device_details.yml From 337d6df638579d02828729f2785f2bf4e3f9f7c4 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Thu, 18 Jul 2024 14:19:55 -0400 Subject: [PATCH 11/27] fix for fix for disable docker if found; re-enable post-bigboot --- bigboot_execute_resize.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bigboot_execute_resize.yml b/bigboot_execute_resize.yml index 78a6ae1..23832d7 100644 --- a/bigboot_execute_resize.yml +++ b/bigboot_execute_resize.yml @@ -77,8 +77,8 @@ - name: Re-enabling Docker service due to overlay filesystem incompatibility ansible.builtin.service: name: docker.service - state: stopped - enabled: false + state: started + enabled: true - name: Re-enabling services previously disabled ansible.builtin.service: From 0f84be55b28152a35223250d80c23c815c866c2e Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Thu, 18 Jul 2024 16:44:33 -0400 Subject: [PATCH 12/27] fix verify --- bigboot_execute_resize.yml | 2 +- bigboot_setup_environment.yml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bigboot_execute_resize.yml b/bigboot_execute_resize.yml index 23832d7..08cf67b 100644 --- a/bigboot_execute_resize.yml +++ b/bigboot_execute_resize.yml @@ -74,7 +74,7 @@ when: - bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | bool - - name: Re-enabling Docker service due to overlay filesystem incompatibility + - name: Re-enabling Docker service ansible.builtin.service: name: docker.service state: started diff --git a/bigboot_setup_environment.yml b/bigboot_setup_environment.yml index 53d236d..0bcbba2 100644 --- a/bigboot_setup_environment.yml +++ b/bigboot_setup_environment.yml @@ -12,11 +12,11 @@ - name: Cleanup from any previous executions ansible.builtin.import_tasks: tasks/cleanup.yml - - name: Disable Docker service if present due to incompatibility - ansible.builtin.service: - name: docker.service - state: stopped - enabled: false + # - name: Disable Docker service if present due to incompatibility + # ansible.builtin.service: + # name: docker.service + # state: stopped + # enabled: false - name: Capture boot device details ansible.builtin.import_tasks: tasks/capture_boot_device_details.yml From 58ffce84edde5af92ed287c2e74de2b398390504 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Fri, 19 Jul 2024 09:37:41 -0400 Subject: [PATCH 13/27] fix verified --- bigboot_setup_environment.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bigboot_setup_environment.yml b/bigboot_setup_environment.yml index 0bcbba2..3685100 100644 --- a/bigboot_setup_environment.yml +++ b/bigboot_setup_environment.yml @@ -12,11 +12,11 @@ - name: Cleanup from any previous executions ansible.builtin.import_tasks: tasks/cleanup.yml - # - name: Disable Docker service if present due to incompatibility - # ansible.builtin.service: - # name: docker.service - # state: stopped - # enabled: false + - name: Disable Docker service due to incompatibility + ansible.builtin.service: + name: docker.service + state: stopped + enabled: false - name: Capture boot device details ansible.builtin.import_tasks: tasks/capture_boot_device_details.yml From eb2e9eb4ae50151fed0c10a400144413100a47fe Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Fri, 19 Jul 2024 21:46:18 -0400 Subject: [PATCH 14/27] fixes --- bigboot_execute_resize.yml | 5 +++++ bigboot_rear_backup.yml | 5 +++-- bigboot_setup_environment.yml | 10 +++++++--- vars/bigboot_vars.yml | 2 +- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/bigboot_execute_resize.yml b/bigboot_execute_resize.yml index 08cf67b..4ddfca7 100644 --- a/bigboot_execute_resize.yml +++ b/bigboot_execute_resize.yml @@ -74,11 +74,16 @@ when: - bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | bool + - name: Get the list of services on the host + ansible.builtin.service_facts: + - name: Re-enabling Docker service ansible.builtin.service: name: docker.service state: started enabled: true + when: + - "'docker.service' in ansible_facts['services']" - name: Re-enabling services previously disabled ansible.builtin.service: diff --git a/bigboot_rear_backup.yml b/bigboot_rear_backup.yml index 7d28ea1..81cbb46 100644 --- a/bigboot_rear_backup.yml +++ b/bigboot_rear_backup.yml @@ -2,5 +2,6 @@ - name: Perform a ReaR backup if any disk modifications are to be made ansible.builtin.import_playbook: rhc.rear.rear_backup when: - - bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | default('false') | bool - - not bigboot_data[inventory_hostname]['bigboot_skip_rear_backup'] | default('true') | bool + - (bigboot_data[inventory_hostname]['bigboot_execute_shrink_lv'] | bool + or bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | bool) + - not bigboot_skip_rear | default('true') | bool diff --git a/bigboot_setup_environment.yml b/bigboot_setup_environment.yml index 3685100..f847126 100644 --- a/bigboot_setup_environment.yml +++ b/bigboot_setup_environment.yml @@ -12,11 +12,16 @@ - name: Cleanup from any previous executions ansible.builtin.import_tasks: tasks/cleanup.yml + - name: Get the list of services on the host + ansible.builtin.service_facts: + - name: Disable Docker service due to incompatibility ansible.builtin.service: name: docker.service state: stopped enabled: false + when: + - "'docker.service' in ansible_facts['services']" - name: Capture boot device details ansible.builtin.import_tasks: tasks/capture_boot_device_details.yml @@ -34,9 +39,8 @@ 'bigboot_execute_shrink_lv': bigboot_execute_shrink_lv, 'bigboot_adjacent_lvm_device': bigboot_adjacent_lvm_device, 'bigboot_lv_shrink_size': bigboot_lv_shrink_size | int, - 'bigboot_size': bigboot_size, - 'bigboot_skip_rear_backup': bigboot_skip_rear | default('false') + 'bigboot_size': bigboot_size } - })}}" + }) }}" ... diff --git a/vars/bigboot_vars.yml b/vars/bigboot_vars.yml index d680b89..825299f 100644 --- a/vars/bigboot_vars.yml +++ b/vars/bigboot_vars.yml @@ -9,7 +9,7 @@ bigboot_reboot_timeout: 1800 bigboot_skip_rear_backup: false # Max value in minutes for the timeout threshold: -bigboot_service_max_timeout: 2 +bigboot_service_max_timeout: 5 # List of services which will be excluded from being # disabled during Bigboot execution: From e1c5d48796cc70babcbd2d830ca613ee1998f371 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Fri, 19 Jul 2024 22:01:47 -0400 Subject: [PATCH 15/27] fixes --- bigboot_execute_resize.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bigboot_execute_resize.yml b/bigboot_execute_resize.yml index 4ddfca7..8fc4a30 100644 --- a/bigboot_execute_resize.yml +++ b/bigboot_execute_resize.yml @@ -19,7 +19,7 @@ - name: Services disabled notice ansible.builtin.debug: - msg: | + msg: >- The following services were disabled, and will be re-enabled post Bigboot execution: From 47b92242238ebd4e0ec2b50340d538b1804e9cc5 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Fri, 19 Jul 2024 23:53:58 -0400 Subject: [PATCH 16/27] logic fixes --- bigboot_rear_backup.yml | 4 +--- bigboot_setup_environment.yml | 6 ++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bigboot_rear_backup.yml b/bigboot_rear_backup.yml index 81cbb46..8677ea6 100644 --- a/bigboot_rear_backup.yml +++ b/bigboot_rear_backup.yml @@ -2,6 +2,4 @@ - name: Perform a ReaR backup if any disk modifications are to be made ansible.builtin.import_playbook: rhc.rear.rear_backup when: - - (bigboot_data[inventory_hostname]['bigboot_execute_shrink_lv'] | bool - or bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | bool) - - not bigboot_skip_rear | default('true') | bool + - not bigboot_rear_backup_skip | default(false) | bool diff --git a/bigboot_setup_environment.yml b/bigboot_setup_environment.yml index f847126..fe44d3d 100644 --- a/bigboot_setup_environment.yml +++ b/bigboot_setup_environment.yml @@ -43,4 +43,10 @@ } }) }}" + - name: Execute ReaR backup + ansible.builtin.include_tasks: bigboot_rear_backup.yml + when: + - not bigboot_rear_backup_skip | default(false) | bool + + ... From d958c3501fc340a4b7ca85a11f40feb3e7af7ed0 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Sat, 20 Jul 2024 00:08:44 -0400 Subject: [PATCH 17/27] more logic fixes --- bigboot_rear_backup.yml | 2 ++ bigboot_setup_environment.yml | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/bigboot_rear_backup.yml b/bigboot_rear_backup.yml index 8677ea6..447847b 100644 --- a/bigboot_rear_backup.yml +++ b/bigboot_rear_backup.yml @@ -2,4 +2,6 @@ - name: Perform a ReaR backup if any disk modifications are to be made ansible.builtin.import_playbook: rhc.rear.rear_backup when: + - (bigboot_data[inventory_hostname]['bigboot_execute_shrink_lv'] | bool + or bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | bool) - not bigboot_rear_backup_skip | default(false) | bool diff --git a/bigboot_setup_environment.yml b/bigboot_setup_environment.yml index fe44d3d..919927b 100644 --- a/bigboot_setup_environment.yml +++ b/bigboot_setup_environment.yml @@ -29,6 +29,10 @@ - name: Capture logical volume information ansible.builtin.import_tasks: tasks/capture_lv_device_details.yml + - name: Set ReaR backup flag + ansible.builtin.set_fact: + bigboot_rear_backup_skip: + - name: Set environment for subsequent workflow nodes ansible.builtin.set_stats: data: @@ -42,10 +46,13 @@ 'bigboot_size': bigboot_size } }) }}" + rear_backup_skip: bigboot_rear_backup_skip | default(false) - name: Execute ReaR backup ansible.builtin.include_tasks: bigboot_rear_backup.yml when: + - (bigboot_data[inventory_hostname]['bigboot_execute_shrink_lv'] | bool + or bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | bool) - not bigboot_rear_backup_skip | default(false) | bool From 37f7723d8c400ca5536a4a23f20e44ad94fc3ff8 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Sat, 20 Jul 2024 00:10:59 -0400 Subject: [PATCH 18/27] fixes --- bigboot_setup_environment.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bigboot_setup_environment.yml b/bigboot_setup_environment.yml index 919927b..6d9fb55 100644 --- a/bigboot_setup_environment.yml +++ b/bigboot_setup_environment.yml @@ -51,8 +51,7 @@ - name: Execute ReaR backup ansible.builtin.include_tasks: bigboot_rear_backup.yml when: - - (bigboot_data[inventory_hostname]['bigboot_execute_shrink_lv'] | bool - or bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | bool) + - (bigboot_execute_bigboot | bool or bigboot_execute_bigboot | bool) - not bigboot_rear_backup_skip | default(false) | bool From 9d5e0cf89d8388dba5a45f12beca1a2889e83de0 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Sat, 20 Jul 2024 00:13:46 -0400 Subject: [PATCH 19/27] fixes --- bigboot_setup_environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bigboot_setup_environment.yml b/bigboot_setup_environment.yml index 6d9fb55..d422f9c 100644 --- a/bigboot_setup_environment.yml +++ b/bigboot_setup_environment.yml @@ -49,7 +49,7 @@ rear_backup_skip: bigboot_rear_backup_skip | default(false) - name: Execute ReaR backup - ansible.builtin.include_tasks: bigboot_rear_backup.yml + ansible.builtin.import_tasks: bigboot_rear_backup.yml when: - (bigboot_execute_bigboot | bool or bigboot_execute_bigboot | bool) - not bigboot_rear_backup_skip | default(false) | bool From da08d182c4ffe4f55de24f6f679608ab609d2e24 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Sat, 20 Jul 2024 00:19:42 -0400 Subject: [PATCH 20/27] fixes --- bigboot_setup_environment.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/bigboot_setup_environment.yml b/bigboot_setup_environment.yml index d422f9c..2189a88 100644 --- a/bigboot_setup_environment.yml +++ b/bigboot_setup_environment.yml @@ -48,11 +48,10 @@ }) }}" rear_backup_skip: bigboot_rear_backup_skip | default(false) - - name: Execute ReaR backup - ansible.builtin.import_tasks: bigboot_rear_backup.yml - when: - - (bigboot_execute_bigboot | bool or bigboot_execute_bigboot | bool) - - not bigboot_rear_backup_skip | default(false) | bool - +- name: Perform a ReaR backup if any disk modifications are to be made + ansible.builtin.import_playbook: rhc.rear.rear_backup + when: + - (bigboot_execute_bigboot | bool or bigboot_execute_bigboot | bool) + - not bigboot_rear_backup_skip | default(false) | bool ... From 788553a9b6b74a048d5a7175ff00aeb6bcffa57c Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Sat, 20 Jul 2024 00:20:50 -0400 Subject: [PATCH 21/27] fixes --- bigboot_setup_environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bigboot_setup_environment.yml b/bigboot_setup_environment.yml index 2189a88..90bcbe2 100644 --- a/bigboot_setup_environment.yml +++ b/bigboot_setup_environment.yml @@ -51,7 +51,7 @@ - name: Perform a ReaR backup if any disk modifications are to be made ansible.builtin.import_playbook: rhc.rear.rear_backup when: - - (bigboot_execute_bigboot | bool or bigboot_execute_bigboot | bool) + - bigboot_execute_bigboot | bool or bigboot_execute_bigboot | bool - not bigboot_rear_backup_skip | default(false) | bool ... From 04dd540fe8fbdf45a762dec5dda61cfd7d226192 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Sat, 20 Jul 2024 00:24:40 -0400 Subject: [PATCH 22/27] fixes --- bigboot_setup_environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bigboot_setup_environment.yml b/bigboot_setup_environment.yml index 90bcbe2..1d356a0 100644 --- a/bigboot_setup_environment.yml +++ b/bigboot_setup_environment.yml @@ -46,7 +46,7 @@ 'bigboot_size': bigboot_size } }) }}" - rear_backup_skip: bigboot_rear_backup_skip | default(false) + rear_backup_skip: "{{ bigboot_rear_backup_skip | default(false) }}" - name: Perform a ReaR backup if any disk modifications are to be made ansible.builtin.import_playbook: rhc.rear.rear_backup From b081b69ba909825e4c4ad630dd6e339e5b17f3a2 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Sun, 21 Jul 2024 00:39:27 -0400 Subject: [PATCH 23/27] debugging --- bigboot_rear_backup.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bigboot_rear_backup.yml b/bigboot_rear_backup.yml index 447847b..01dd972 100644 --- a/bigboot_rear_backup.yml +++ b/bigboot_rear_backup.yml @@ -1,4 +1,12 @@ --- +- name: Debug bigboot_execute_shrink_lv + ansible.builtin.debug: + msg: "bigboot_data[inventory_hostname]['bigboot_execute_shrink_lv'] -> {{ bigboot_data[inventory_hostname]['bigboot_execute_shrink_lv'] }}" + +- name: Debug bigboot_execute_bigboot + ansible.builtin.debug: + msg: "bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] -> {{ bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] }}" + - name: Perform a ReaR backup if any disk modifications are to be made ansible.builtin.import_playbook: rhc.rear.rear_backup when: From 8d289a9d0971905880a0426eb1d1e8bd86b35486 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Sun, 21 Jul 2024 00:45:11 -0400 Subject: [PATCH 24/27] fixdebugging --- bigboot_rear_backup.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/bigboot_rear_backup.yml b/bigboot_rear_backup.yml index 01dd972..7ea55da 100644 --- a/bigboot_rear_backup.yml +++ b/bigboot_rear_backup.yml @@ -1,11 +1,18 @@ --- -- name: Debug bigboot_execute_shrink_lv - ansible.builtin.debug: - msg: "bigboot_data[inventory_hostname]['bigboot_execute_shrink_lv'] -> {{ bigboot_data[inventory_hostname]['bigboot_execute_shrink_lv'] }}" +- name: Capture boot and logical volume information + hosts: all + become: true + gather_facts: true + strategy: free -- name: Debug bigboot_execute_bigboot - ansible.builtin.debug: - msg: "bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] -> {{ bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] }}" + tasks: + - name: Debug bigboot_execute_shrink_lv + ansible.builtin.debug: + msg: "bigboot_data[inventory_hostname]['bigboot_execute_shrink_lv'] -> {{ bigboot_data[inventory_hostname]['bigboot_execute_shrink_lv'] }}" + + - name: Debug bigboot_execute_bigboot + ansible.builtin.debug: + msg: "bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] -> {{ bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] }}" - name: Perform a ReaR backup if any disk modifications are to be made ansible.builtin.import_playbook: rhc.rear.rear_backup From 3cc0f210e624e44527d02621585830be39aaeb74 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Sun, 21 Jul 2024 00:56:04 -0400 Subject: [PATCH 25/27] task rename --- bigboot_rear_backup.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bigboot_rear_backup.yml b/bigboot_rear_backup.yml index 7ea55da..786c8c7 100644 --- a/bigboot_rear_backup.yml +++ b/bigboot_rear_backup.yml @@ -14,7 +14,7 @@ ansible.builtin.debug: msg: "bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] -> {{ bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] }}" -- name: Perform a ReaR backup if any disk modifications are to be made +- name: Perform a ReaR backup before the /boot expansion ansible.builtin.import_playbook: rhc.rear.rear_backup when: - (bigboot_data[inventory_hostname]['bigboot_execute_shrink_lv'] | bool From 9284232e477c9bb592d73c2af691be12770412cd Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Sun, 21 Jul 2024 00:58:44 -0400 Subject: [PATCH 26/27] include role instead of import playbook --- bigboot_rear_backup.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bigboot_rear_backup.yml b/bigboot_rear_backup.yml index 786c8c7..039155f 100644 --- a/bigboot_rear_backup.yml +++ b/bigboot_rear_backup.yml @@ -5,6 +5,9 @@ gather_facts: true strategy: free + vars_files: + - bigboot_vars.yml + tasks: - name: Debug bigboot_execute_shrink_lv ansible.builtin.debug: @@ -15,7 +18,8 @@ msg: "bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] -> {{ bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] }}" - name: Perform a ReaR backup before the /boot expansion - ansible.builtin.import_playbook: rhc.rear.rear_backup + ansible.builtin.include_role: + name: rhc.rear.rear_backup when: - (bigboot_data[inventory_hostname]['bigboot_execute_shrink_lv'] | bool or bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | bool) From 164307eab7b15253adc6b8d591ee6e3043a6ad4f Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Sun, 21 Jul 2024 00:59:53 -0400 Subject: [PATCH 27/27] nevermind; reverted --- bigboot_rear_backup.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/bigboot_rear_backup.yml b/bigboot_rear_backup.yml index 039155f..786c8c7 100644 --- a/bigboot_rear_backup.yml +++ b/bigboot_rear_backup.yml @@ -5,9 +5,6 @@ gather_facts: true strategy: free - vars_files: - - bigboot_vars.yml - tasks: - name: Debug bigboot_execute_shrink_lv ansible.builtin.debug: @@ -18,8 +15,7 @@ msg: "bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] -> {{ bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] }}" - name: Perform a ReaR backup before the /boot expansion - ansible.builtin.include_role: - name: rhc.rear.rear_backup + ansible.builtin.import_playbook: rhc.rear.rear_backup when: - (bigboot_data[inventory_hostname]['bigboot_execute_shrink_lv'] | bool or bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | bool)