Add remove action for Volum Group resource

This commit is contained in:
Łukasz Oleś 2015-09-03 11:22:26 +00:00
parent 87caa5bc5f
commit 2becead51f

View 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