diff --git a/resources/volume_group/actions/remove.yaml b/resources/volume_group/actions/remove.yaml index 60e6520..61a8014 100644 --- a/resources/volume_group/actions/remove.yaml +++ b/resources/volume_group/actions/remove.yaml @@ -4,11 +4,13 @@ - 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}' + shell: losetup -a|grep "{{path}}"|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 + - name: remove file + file: path={{path}} state=absent