Fix to allow per-host Bigboot executions

This commit is contained in:
Chris Hammer 2024-07-17 18:22:49 -04:00
parent b42b725c35
commit c34ecde485
3 changed files with 18 additions and 13 deletions

View File

@ -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:

View File

@ -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

View File

@ -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')
}
})}}"
...