mg
169abbedff
Co-authored-by: Michael Grote <michael.grote@posteo.de> Reviewed-on: mg/ansible#363 Co-authored-by: mg <michael.grote@posteo.de> Co-committed-by: mg <michael.grote@posteo.de>
31 lines
763 B
YAML
31 lines
763 B
YAML
---
|
|
- name: manage_lvm | manage physical volume group creation
|
|
include_tasks: create_vg.yml
|
|
loop: "{{ lvm_groups }}"
|
|
loop_control:
|
|
loop_var: vg
|
|
|
|
- name: manage_lvm | Removing LVM logical volume(s)
|
|
lvol:
|
|
vg: "{{ item.0.vgname }}"
|
|
lv: "{{ item.1.lvname }}"
|
|
state: absent
|
|
force: true
|
|
become: true
|
|
loop: "{{ lvm_groups|subelements('lvnames', {'skip_missing': true}) }}"
|
|
when:
|
|
- item.1 is defined
|
|
- item.1 != 'None'
|
|
- item.1.create is defined
|
|
- not item.1.create|bool
|
|
|
|
- name: manage_lvm | Removing LVM volume group(s)
|
|
lvg:
|
|
vg: "{{ item.vgname }}"
|
|
pvs: "{{ item.disks | join(',') }}"
|
|
state: absent
|
|
become: true
|
|
loop: "{{ lvm_groups }}"
|
|
when:
|
|
- item.create is defined
|
|
- not item.create|bool
|