molecule test and idempotence

This commit is contained in:
Charlie Mordant
2020-04-15 14:33:41 +02:00
parent fe860566ba
commit ea9109220b
19 changed files with 488 additions and 121 deletions
+22
View File
@@ -0,0 +1,22 @@
---
- name: manage_lvm | check existing physical volume group(s)
shell: "vgdisplay | grep '{{ item['vgname'] }}'"
become: true
with_items: "{{ lvm_groups }}"
ignore_errors: True
changed_when: no
register: vg_exist
- debug: var=vg_exist
- name: manage_lvm | creating new LVM physical volume group(s)
lvg:
vg: "{{ item.item['vgname'] }}"
pvs: "{{ item.item['disks']|join(',') }}"
state: "present"
become: true
with_items: "{{ vg_exist.results }}"
when: >
item.rc != 0 and
item.item['create'] is defined and
item.item['create']