Compare commits

20 Commits

Author SHA1 Message Date
6b3a346d2d Update filename
Some checks failed
Ansible Code Pipeline / Ansible-Development-Pipeline (ansible-dev-fedora41) (push) Failing after 11s
2025-07-09 00:15:33 -04:00
66524c6bb2 Enabling Actions
Some checks failed
Ansible Code Pipeline / Ansible-Development-Pipeline (ansible-dev-fedora41) (push) Failing after 3s
2025-07-09 00:15:03 -04:00
fd809949f7 Formatting 2025-07-09 00:10:35 -04:00
971cc1bdfe Formatting 2025-06-26 10:05:12 -04:00
6e8726bddd Updates 2025-06-25 16:11:18 -04:00
5d18d161fe Remove exception to force test 2025-06-24 15:04:34 -04:00
147c63ba89 Subtract an additional PE over the one we're already subtracting - 2 PE total 2025-06-24 12:10:24 -04:00
5c3987bfa7 Put exception back in 2025-06-24 11:39:03 -04:00
12f1c050cf Comment out exception 2025-06-24 11:27:02 -04:00
943fb1b24f Don't subtract the additional PE if the target size matches the intended target size 2025-06-24 11:00:00 -04:00
f39fea0f89 Calculate PE size, and subtract from the shrink size; Attempts to fix allocation/pretending size issue 2025-06-23 17:35:28 -04:00
23c7547f32 Restore shrink size to defined value 2025-06-05 10:47:20 -04:00
78902c1371 Remove 4MB from calculated LVB size 2025-06-05 10:26:33 -04:00
8e057342da pvsqueeze restoration 2025-06-05 10:11:02 -04:00
8106b95478 Remove pvsqueeze execution tasks for testing 2025-06-05 04:49:15 -04:00
a3d5c17253 Add functions to filter plugin; Tweaks 2025-06-05 02:51:07 -04:00
5cb1b9d68f Add tasks to capture block size instead of filesystem size 2025-06-04 22:50:46 -04:00
9a9aa83adb Tweaks 2025-06-03 10:23:23 -04:00
53f3dbc6c8 Remove end_host 2025-06-03 10:21:30 -04:00
50faad8c17 . 2025-06-03 10:20:53 -04:00
7 changed files with 56 additions and 20 deletions

View File

@ -1,3 +1,3 @@
export ANSIBLE_LINT_EXCLUSION="--exclude collections/ansible_collections --exclude .gitea"
export ANSIBLE_INVENTORY="-i 127.0.0.1, --connection=local"
export ANSIBLE_PLAYBOOK="bigboot-v2.yml"
export ANSIBLE_PLAYBOOK="bigboot_setup_environment.yml"

View File

@ -3,13 +3,13 @@ run-name: ${{ gitea.actor }} is running Ansible Code Pipeline
on:
push:
branches:
- main
- develop
jobs:
Ansible-Development-Pipeline:
strategy:
matrix:
os: [ ansible-dev-centos9, ansible-dev-fedora39, ansible-dev-debian11, ansible-dev-debian12 ]
os: [ ansible-dev-fedora41 ]
runs-on: ${{ matrix.os }}
steps:
- name: Clone repository
@ -17,7 +17,7 @@ jobs:
- name: Ansible Environment Verify
run: |
. ./.drone.env
. ./.ci.env
env
git log -1
ansible --version
@ -29,7 +29,7 @@ jobs:
- name: Run Ansible-Lint
run: |
. ./.drone.env
. ./.ci.env
ansible-lint --offline $ANSIBLE_LINT_EXCLUSION
# - name: Run Ansible-Playbook

View File

@ -7,7 +7,9 @@ class FilterModule (object):
return {
'get_block_size_up': self.get_block_size_up,
'get_block_size_down': self.get_block_size_down,
'moo': self.moo,
'get_block_size_up_bytes': self.get_block_size_up_bytes,
'get_block_size_down_bytes': self.get_block_size_down_bytes,
'moo': self.moo
}
@ -21,6 +23,16 @@ class FilterModule (object):
start_size -= 1
return ('{}{}'.format(start_size, 'M'))
def get_block_size_up_bytes(self, start_size):
while start_size % BLOCK_SIZE != 0:
start_size += 1
return ('{}'.format(start_size))
def get_block_size_down_bytes(self, start_size):
while start_size % BLOCK_SIZE != 0:
start_size -= 1
return ('{}'.format(start_size))
def moo(self, a_variable):
a_new_variable = (str(a_variable) + '~~~~MOOOOOOOOOOOOOOOOOOOOOOOOO! => ' + '%s' % type(a_variable))
return a_new_variable

View File

@ -41,7 +41,7 @@
that: bigboot_boot_partsize | human_to_bytes >= bigboot_size_min | human_to_bytes
success_msg: >
/boot partition size is already at least {{ bigboot_size_min }}
or greater. Nothing to do."
or greater. Nothing to do.
fail_msg: >
/boot partition size is less than {{ bigboot_size_min }}.
Expansion of /boot is required.
@ -54,5 +54,5 @@
- name: Expansion of /boot required
ansible.builtin.debug:
msg: >
Will attempt to increase to {{ bigboot_size_target }}, or
{{ bigboot_size_min }} at the minimum."
Will attempt to increase to {{ bigboot_size_target }},
or {{ bigboot_size_min }} at the minimum.

View File

@ -47,8 +47,17 @@
# that: bigboot_lv_info.size_available > bigboot_expansion_diff | int
# fail_msg: There is not enough space available for LV shrinking.
- name: Set initial target size for fallback
- name: Capture UUID for target volume
ansible.builtin.set_fact:
bigboot_lv_uuid: "{{ ansible_facts['mounts'] | selectattr('device', 'equalto', bigboot_adjacent_lvm_device) | map(attribute='uuid') | first }}"
- name: Capture block device information for target logical volume
ansible.builtin.set_fact:
bigboot_lv_dm: "{{ ansible_device_links['uuids'] | dict2items | selectattr('value', 'contains', bigboot_lv_uuid) | map(attribute='key') | first }}"
- name: Set initial sizes for logical volume and fallback size target
ansible.builtin.set_fact:
bigboot_lv_partsize: "{{ ansible_devices[bigboot_lv_dm]['sectors'] | int * ansible_devices[bigboot_lv_dm]['sectorsize'] | int }}"
bigboot_size_target_fallback: "{{ bigboot_size_target | human_to_bytes }}"
- name: Check available space and fallback to lower /boot size if required
@ -56,15 +65,13 @@
- name: Capture shrink and fallback sizes
ansible.builtin.set_fact:
bigboot_lv_shrink_size: "{{ bigboot_lv_info['size_total'] - bigboot_expansion_diff | int }}"
# we need to get the BLOCK size total, not the filesystem
bigboot_lv_shrink_size: "{{ bigboot_lv_partsize | int - bigboot_expansion_diff | int }}"
bigboot_size_target_fallback: "{{ bigboot_size_target_fallback | int | human_readable(unit='G') | regex_replace('\\sGB', 'G') }}"
- name: Debug bigboot_lv_shrink_size and bigboot_size_target_fallback
ansible.builtin.debug:
msg: "{{ bigboot_lv_shrink_size | int | human_readable(unit='G') }} <-> {{ bigboot_size_target_fallback }}"
- name: Kill the play
ansible.builtin.meta: end_host
msg: "{{ bigboot_lv_shrink_size | int | human_readable(unit='G') }} ({{ bigboot_lv_shrink_size | int | human_readable(unit='M') | regex_replace('\\.\\d+\\s+MB') | int | get_block_size_down }}) <-> {{ bigboot_size_target_fallback }} | {{ bigboot_expansion_diff }}"
- name: Capture logical volume name
ansible.builtin.shell:
@ -88,6 +95,23 @@
changed_when: false
register: bigboot_lv_vg_free_pe
- name: Capture volume group PE size
ansible.builtin.shell:
cmd: |
set -o pipefail
vgdisplay {{ bigboot_lv_vg_name | trim }} | grep -i 'pe size'
executable: /bin/bash
changed_when: false
register: bigboot_lv_vg_pe_capture
- name: Set PE size
ansible.builtin.set_fact:
bigboot_lv_vg_pe_size: "{{ bigboot_lv_vg_pe_capture | regex_replace('^.*\\s+(\\d+.\\d+).*$', '\\1M') | human_to_bytes }}"
- name: Subtract an additional 2 PE for shrinking
ansible.builtin.set_fact:
bigboot_lv_shrink_size: "{{ bigboot_lv_shrink_size | int - (bigboot_lv_vg_pe_size | int * 2) }}"
- name: Capture the PV device
ansible.builtin.set_fact:
bigboot_pv: "{{ bigboot_boot_mount['device'][:-1] }}{{ bigboot_boot_mount['device'][-1:] | int + 1 }}"
@ -116,7 +140,7 @@
- name: Assert if we need to shrink the logical volume to gain PE
ansible.builtin.assert:
that: (bigboot_lv_pe_size_in_mb[:-3] | int) >= (bigboot_expansion_diff_mb[:-3] | int)
fail_msg: Not enough PE to expand /boot. Will need to shrink target LV.
fail_msg: Not enough PE to expand /boot.
rescue:
- name: Set flag for Shrink_LV execution

View File

@ -19,13 +19,14 @@
- name: Assert that there will be enough space left over on the target LV
ansible.builtin.assert:
that: (bigboot_lv_info['size_available'] - bigboot_expansion_diff | int) >= bigboot_lv_size_min | human_to_bytes
success_msg: "There will be enough space left over with a boot size of {{ bigboot_size_target_fallback | int | human_readable(unit='G') }}. ({{ (bigboot_lv_info['size_available'] - bigboot_expansion_diff | int) | human_readable(unit='B') }})"
fail_msg: "There will NOT be enough space left over with a boot size of {{ bigboot_size_target_fallback | int | human_readable(unit='G') }}. Aborting Bigboot execution."
# success_msg: "There will be enough space left over with a boot size of {{ bigboot_size_target_fallback | int | human_readable(unit='G') }}. ({{ (bigboot_lv_info['size_total'] - bigboot_expansion_diff | int) | human_readable(unit='B') }})"
fail_msg: "There will NOT be enough space left over with a boot size of {{ bigboot_size_target_fallback | int | human_readable(unit='G') }}."
rescue:
- name: "Decrement size target by {{ bigboot_size_decrement }}"
ansible.builtin.set_fact:
bigboot_size_target_fallback: "{{ bigboot_size_target_fallback | int - bigboot_size_decrement | human_to_bytes }}"
bigboot_size_target_fallback:
"{{ bigboot_size_target_fallback | int - bigboot_size_decrement | human_to_bytes }}"
- name: Update required expansion space
ansible.builtin.set_fact:

View File

@ -4,7 +4,6 @@ ansible_ssh_retries: 10
bigboot_size_target: 2G
bigboot_size_min: 1G
bigboot_size_decrement: 250M
bigboot_lv_size_min: 1G
# Filename of disabled services log: