Add remove action for Volum Group resource
This commit is contained in:
parent
87caa5bc5f
commit
2becead51f
14
resources/volume_group/actions/remove.yaml
Normal file
14
resources/volume_group/actions/remove.yaml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
- hosts: [{{ ip }}]
|
||||||
|
sudo: yes
|
||||||
|
tasks:
|
||||||
|
- name: remove VG
|
||||||
|
lvg: vg={{name}} state=absent force=yes
|
||||||
|
- name: find loop device
|
||||||
|
shell: losetup -a|grep "/root/cinder.img"|awk -F':' '{print $1}'
|
||||||
|
register: loop_device
|
||||||
|
- name: if loop device exists, delete it
|
||||||
|
command: sudo losetup -d {% raw %}{{item}}{% endraw %}
|
||||||
|
when: loop_device|success
|
||||||
|
with_items: loop_device.stdout_lines
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user