regex fixes and cleanup
All checks were successful
Ansible Code Pipeline / Ansible-Development-Pipeline (ansible-dev-centos9) (push) Successful in 16s
Ansible Code Pipeline / Ansible-Development-Pipeline (ansible-dev-debian11) (push) Successful in 13s
Ansible Code Pipeline / Ansible-Development-Pipeline (ansible-dev-debian12) (push) Successful in 13s
Ansible Code Pipeline / Ansible-Development-Pipeline (ansible-dev-fedora39) (push) Successful in 15s

This commit is contained in:
2024-02-16 00:49:19 -05:00
parent 3df16e6e47
commit f7c135d5d2
2 changed files with 2 additions and 11 deletions

View File

@ -48,14 +48,14 @@
# Ex:
# Free PE / Size 320 / 1.25 GiB"
# Free PE / Size 189 / 756.00 MiB"
# Free PE / Size 414 / <1.62 GiB
# Free PE / Size 0 / 0
bigboot_lv_vg_free_pe: "{{ bigboot_lv_vg_free_pe.stdout | regex_replace('^.*/.*/\\s+(.*)', '\\1') }}"
bigboot_lv_vg_free_pe: "{{ bigboot_lv_vg_free_pe.stdout | regex_replace('^.*/.*/\\s+[<]?(.*)', '\\1') }}"
- name: Get size only from the values
ansible.builtin.set_fact:
bigboot_lv_size_in_mb:
"{{ bigboot_lv_vg_free_pe | regex_replace('i|\\s+|<', '') | human_to_bytes | human_readable(unit='M') }}"
# "{{ bigboot_lv_vg_free_pe | regex_replace('i', '') | regex_replace(' ', '') | human_to_bytes | human_readable(unit='M') }}"
bigboot_size_in_mb: "{{ bigboot_size[:-1] }}"
- name: Check if we can shrink the logical volume
@ -65,7 +65,6 @@
that:
- bigboot_lv_vg_free_pe[:-4] != ''
- (bigboot_lv_size_in_mb[:-6] | int - bigboot_size_in_mb | int ) >= 0
# - (bigboot_lv_info.size_available - bigboot_size | human_to_bytes) >= 0
fail_msg: Not enough free PE available for /boot expansion.
rescue: