|
|
|
@ -1,18 +1,32 @@
|
|
|
|
|
---
|
|
|
|
|
- name: Capture logical volume adjacent to /boot
|
|
|
|
|
- name: Capture all logical volume paritions on /boot device
|
|
|
|
|
ansible.builtin.shell:
|
|
|
|
|
cmd: |
|
|
|
|
|
set -o pipefail
|
|
|
|
|
lsblk -pl -o name,type,mountpoint {{ bigboot_boot_mount['device'][:-1] }} \
|
|
|
|
|
| grep -vi swap | grep lvm | head -1 | awk '{ print $1}'
|
|
|
|
|
lsblk -pl -o name,type {{ bigboot_boot_mount['device'][:-1] }} | grep -i lvm
|
|
|
|
|
executable: /bin/bash
|
|
|
|
|
changed_when: false
|
|
|
|
|
failed_when: bigboot_adjacent_lvm['rc'] not in [0, 141]
|
|
|
|
|
register: bigboot_adjacent_lvm
|
|
|
|
|
failed_when: bigboot_adjacent_lvm['rc'] not in [0,141]
|
|
|
|
|
|
|
|
|
|
- name: Map the device to its mount point if applicable
|
|
|
|
|
ansible.builtin.set_fact:
|
|
|
|
|
bigboot_adjacent_lvm_devices: "{{ bigboot_adjacent_lvm_devices | default([]) | combine({item | split(' ') | first: ansible_facts['mounts'] | selectattr('device', 'equalto', item | split(' ') | first) | map(attribute='mount')}) }}"
|
|
|
|
|
loop: "{{ bigboot_adjacent_lvm['stdout_lines'] }}"
|
|
|
|
|
|
|
|
|
|
- name: Capture the device name of the mounted logical volumes
|
|
|
|
|
ansible.builtin.set_fact:
|
|
|
|
|
bigboot_lvm_mounts: "{{ bigboot_lvm_mounts | default([]) + [item['key']] }}"
|
|
|
|
|
loop: "{{ bigboot_adjacent_lvm_devices | dict2items }}"
|
|
|
|
|
when: item['value'] | regex_search("[a-zA-Z]")
|
|
|
|
|
|
|
|
|
|
- name: Set adjacent LVM device name
|
|
|
|
|
ansible.builtin.set_fact:
|
|
|
|
|
bigboot_adjacent_lvm_device: "{{ bigboot_adjacent_lvm.stdout }}"
|
|
|
|
|
bigboot_adjacent_lvm_device: "{{ bigboot_lvm_mounts | first }}"
|
|
|
|
|
|
|
|
|
|
- name: Debug bigboot_adjacent_lvm_device
|
|
|
|
|
ansible.builtin.debug:
|
|
|
|
|
var: bigboot_adjacent_lvm_device
|
|
|
|
|
|
|
|
|
|
- name: Get logical volume mount information
|
|
|
|
|
ansible.builtin.set_fact:
|
|
|
|
|