Initial project commit
This commit is contained in:
28
lvol-testing2.yml
Normal file
28
lvol-testing2.yml
Normal file
@ -0,0 +1,28 @@
|
||||
---
|
||||
- name: LVOL Testing
|
||||
hosts: bigboot
|
||||
gather_facts: true
|
||||
|
||||
vars:
|
||||
check_vg: system
|
||||
check_lv: root
|
||||
check_pv: sda2
|
||||
|
||||
tasks:
|
||||
- name: Run pvdisplay command
|
||||
ansible.builtin.command: "pvdisplay -m /dev/{{ check_pv }}"
|
||||
register: pvdisplay_output
|
||||
|
||||
- name: Parse pvdisplay output for free extents
|
||||
ansible.builtin.set_fact:
|
||||
free_extents: "{{ pvdisplay_output.stdout | regex_findall('Physical extent [0-9]+ to [0-9]+:\\s+FREE') }}"
|
||||
|
||||
- name: Parse pvdisplay output for root logical volume extents
|
||||
ansible.builtin.set_fact:
|
||||
root_extents: "{{ pvdisplay_output.stdout | regex_findall('Physical extent [0-9]+ to [0-9]+:\\s+Logical volume\\s+/dev/system/root') }}"
|
||||
|
||||
- name: Check if root logical volume is broken up by free extents
|
||||
ansible.builtin.debug:
|
||||
msg: >
|
||||
The root logical volume is broken up by free extents:
|
||||
{{ free_extents | length > 0 and root_extents | length > 1 }}
|
Reference in New Issue
Block a user