From 39598669540dd44bb651f5bd6e8f6603630d5089 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Mon, 19 Feb 2024 12:06:56 -0500 Subject: [PATCH] Variable re-naming and cleanup --- bigboot-v3.yml | 7 +++---- tasks/bigboot_manage_lv.yml | 2 +- tasks/capture_boot_device_details.yml | 6 +++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/bigboot-v3.yml b/bigboot-v3.yml index f0280c4..5911c86 100644 --- a/bigboot-v3.yml +++ b/bigboot-v3.yml @@ -5,7 +5,7 @@ gather_facts: true vars: - bigboot_size: 1G + bigboot_size_target: 1G tasks: - name: Capture boot device details @@ -15,7 +15,6 @@ ansible.builtin.import_tasks: tasks/bigboot_manage_lv.yml - name: Expand the /boot partition as requested - ansible.builtin.import_role: + ansible.builtin.include_role: name: infra.lvm_snapshots.bigboot - vars: - bigboot_size: "{{ bigboot_size_target }}" + diff --git a/tasks/bigboot_manage_lv.yml b/tasks/bigboot_manage_lv.yml index 45dcb6b..726b53a 100644 --- a/tasks/bigboot_manage_lv.yml +++ b/tasks/bigboot_manage_lv.yml @@ -66,7 +66,7 @@ block: - name: Assert if we need to execute the shrink_lv role to gain free PE ansible.builtin.assert: - that: (bigboot_lv_pe_size_in_mb[:-3] | int | round) | int > bigboot_size_target[:-1] | int + that: (bigboot_lv_pe_size_in_mb[:-3] | int | round) | int > bigboot_size[:-1] | int fail_msg: Not enough PE to expand /boot. rescue: diff --git a/tasks/capture_boot_device_details.yml b/tasks/capture_boot_device_details.yml index a30bcd0..f71812c 100644 --- a/tasks/capture_boot_device_details.yml +++ b/tasks/capture_boot_device_details.yml @@ -19,7 +19,7 @@ - name: Capture required expansion space ansible.builtin.set_fact: bigboot_expansion_diff: - "{{ bigboot_size | human_to_bytes - bigboot_boot_partsize | human_to_bytes }}" + "{{ bigboot_size_target | human_to_bytes - bigboot_boot_partsize | human_to_bytes }}" - name: Convert size difference to MB ansible.builtin.set_fact: @@ -27,7 +27,7 @@ - name: Set bigboot size 4k aligned ansible.builtin.set_fact: - bigboot_size_target: "{{ bigboot_size_expansion_mb[:-2] | int | get_block_size_up }}" + bigboot_size: "{{ bigboot_size_expansion_mb[:-2] | int | get_block_size_up }}" - name: Validate if we need to expand boot block: @@ -43,4 +43,4 @@ rescue: - name: Expansion of /boot required ansible.builtin.debug: - msg: "Will need to expand /boot by an additional {{ bigboot_size_target }}." + msg: "Will need to expand /boot by an additional {{ bigboot_size }}."