Compare commits

..

No commits in common. "8beb34f55359a7fc0ac62e9b48197c350f1a6daf" and "d6de38bfbcbf1c9bdc6c34c3cf4df740601da503" have entirely different histories.

6 changed files with 97 additions and 101 deletions

1
.gitignore vendored
View File

@ -7,4 +7,3 @@ filter_plugins/*.bak
python/ python/
collections/ansible_collections collections/ansible_collections
roles/autofsck roles/autofsck
*.bak

View File

@ -18,17 +18,79 @@
- name: Capture logical volume information - name: Capture logical volume information
ansible.builtin.import_tasks: tasks/capture_lv_device_details.yml ansible.builtin.import_tasks: tasks/capture_lv_device_details.yml
- name: Set environment for subsequent workflow nodes
ansible.builtin.set_stats: - name: Perform a ReaR backup if any disk modifications are to be made
data: ansible.builtin.import_playbook: rhc.rear.rear_backup
bigboot_data: "{{ bigboot_data | default({}) | when:
combine({inventory_hostname: - bigboot_execute_bigboot | default('false') | bool
{ - not bigboot_skip_rear_backup | default('true') | bool
'bigboot_execute_bigboot': bigboot_execute_bigboot,
'bigboot_execute_shrink_lv': bigboot_execute_shrink_lv,
'bigboot_adjacent_lvm_device': bigboot_adjacent_lvm_device, - name: Perform logical volume and boot parition resizing as needed
'bigboot_lv_shrink_size': bigboot_lv_shrink_size | int, hosts: all
'bigboot_size': bigboot_size, become: true
'bigboot_skip_rear_backup': bigboot_skip_rear | default('false') gather_facts: true
} strategy: free
})}}"
vars_files:
- bigboot_vars.yml
tasks:
- name: Perform filesystem check prior to Bigboot execution
when:
- (bigboot_execute_shrink_lv | bool or bigboot_execute_bigboot | 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: 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:
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

View File

@ -9,25 +9,10 @@
- bigboot_vars.yml - bigboot_vars.yml
tasks: tasks:
- name: Perform service and filesystem checks prior to Bigboot execution - name: Perform filesystem check prior to Bigboot execution
when: when:
- (bigboot_data[inventory_hostname]['bigboot_execute_shrink_lv'] | bool - (bigboot_execute_shrink_lv | bool or bigboot_execute_bigboot | bool)
or bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | bool)
block: block:
- 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 | flatten }}
when:
- bigboot_systemd_disabled_services is defined
- bigboot_systemd_disabled_services | length > 0
- name: Enable Grub filesystem check - name: Enable Grub filesystem check
ansible.builtin.import_role: ansible.builtin.import_role:
name: autofsck name: autofsck
@ -48,6 +33,9 @@
- name: Flush handlers - name: Flush handlers
ansible.builtin.meta: 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 - name: Extend the timeout values for physical hosts
ansible.builtin.set_fact: ansible.builtin.set_fact:
@ -61,29 +49,16 @@
name: infra.lvm_snapshots.shrink_lv name: infra.lvm_snapshots.shrink_lv
vars: vars:
shrink_lv_devices: shrink_lv_devices:
- device: "{{ bigboot_data[inventory_hostname]['bigboot_adjacent_lvm_device'] }}" - device: "{{ bigboot_adjacent_lvm_device }}"
size: "{{ bigboot_data[inventory_hostname]['bigboot_lv_shrink_size'] | int }}" size: "{{ bigboot_lv_shrink_size | int }}"
when: when:
- bigboot_data[inventory_hostname]['bigboot_execute_shrink_lv'] | bool - bigboot_execute_shrink_lv | bool
- name: Expand the /boot partition as requested - name: Expand the /boot partition as requested
ansible.builtin.import_role: ansible.builtin.import_role:
name: infra.lvm_snapshots.bigboot name: infra.lvm_snapshots.bigboot
vars:
bigboot_size: "{{ bigboot_data[inventory_hostname]['bigboot_size'] }}"
when: when:
- bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | bool - 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 - name: Re-enabling services previously disabled
ansible.builtin.service: ansible.builtin.service:

View File

@ -1,22 +1,6 @@
--- ---
- name: Capture boot and logical volume information - name: Perform a ReaR backup if any disk modifications are to be made
hosts: all
become: true
gather_facts: true
strategy: free
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 before the /boot expansion
ansible.builtin.import_playbook: rhc.rear.rear_backup ansible.builtin.import_playbook: rhc.rear.rear_backup
when: when:
- (bigboot_data[inventory_hostname]['bigboot_execute_shrink_lv'] | bool - bigboot_execute_bigboot | default('false') | bool
or bigboot_data[inventory_hostname]['bigboot_execute_bigboot'] | bool) - not bigboot_skip_rear_backup | default('true') | bool
- not bigboot_rear_backup_skip | default(false) | bool

View File

@ -12,46 +12,22 @@
- name: Cleanup from any previous executions - name: Cleanup from any previous executions
ansible.builtin.import_tasks: tasks/cleanup.yml 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 - name: Capture boot device details
ansible.builtin.import_tasks: tasks/capture_boot_device_details.yml ansible.builtin.import_tasks: tasks/capture_boot_device_details.yml
- name: Capture logical volume information - name: Capture logical volume information
ansible.builtin.import_tasks: tasks/capture_lv_device_details.yml 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 - name: Set environment for subsequent workflow nodes
ansible.builtin.set_stats: ansible.builtin.set_stats:
data: data:
bigboot_data: "{{ bigboot_data | default({}) | bigboot_execute_bigboot: "{{ bigboot_execute_bigboot }}"
combine({inventory_hostname: bigboot_execute_shrink_lv: "{{ bigboot_execute_shrink_lv }}"
{ bigboot_adjacent_lvm_device: "{{ bigboot_adjacent_lvm_device }}"
'bigboot_execute_bigboot': bigboot_execute_bigboot, bigboot_lv_shrink_size: "{{ bigboot_lv_shrink_size | int }}"
'bigboot_execute_shrink_lv': bigboot_execute_shrink_lv, bigboot_size: "{{ bigboot_size }}"
'bigboot_adjacent_lvm_device': bigboot_adjacent_lvm_device, bigboot_skip_rear_backup: "{{ bigboot_skip_rear | default('false') }}"
'bigboot_lv_shrink_size': bigboot_lv_shrink_size | int, per_host: false
'bigboot_size': bigboot_size aggregate: 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
when:
- bigboot_execute_bigboot | bool or bigboot_execute_bigboot | bool
- not bigboot_rear_backup_skip | default(false) | bool
... ...

View File

@ -9,7 +9,7 @@ bigboot_reboot_timeout: 1800
bigboot_skip_rear_backup: false bigboot_skip_rear_backup: false
# Max value in minutes for the timeout threshold: # Max value in minutes for the timeout threshold:
bigboot_service_max_timeout: 5 bigboot_service_max_timeout: 2
# List of services which will be excluded from being # List of services which will be excluded from being
# disabled during Bigboot execution: # disabled during Bigboot execution: