From c34ecde4850ec60b20af8d1c66d133e691aa001a Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Wed, 17 Jul 2024 18:22:49 -0400 Subject: [PATCH] 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') + } + })}}" ...