Use comments as tasks names
This commit is contained in:
parent
6989f9fd70
commit
87caa5bc5f
@ -1,19 +1,19 @@
|
||||
- hosts: [{{ ip }}]
|
||||
sudo: yes
|
||||
tasks:
|
||||
# install dependencies
|
||||
- apt: name=lvm2 state=present
|
||||
# preapara file
|
||||
- command: truncate -s 10G {{path}} creates={{path}}
|
||||
# check if loop for file is already created
|
||||
- shell: losetup -a|grep {{path}}
|
||||
- name: install dependencies
|
||||
apt: name=lvm2 state=present
|
||||
- name: preapara file
|
||||
command: truncate -s 10G {{path}} creates={{path}}
|
||||
- name: check if loop for file is already created
|
||||
shell: losetup -a|grep {{path}}
|
||||
register: loop_created
|
||||
ignore_errors: True
|
||||
# if loop is not created, create it
|
||||
- command: losetup -f {{path}}
|
||||
- name: if loop is not created, create it
|
||||
command: losetup -f {{path}}
|
||||
when: loop_created|failed
|
||||
# get loop, for example /dev/loop0
|
||||
- shell: losetup -a|grep '{{path}}'|awk -F':' '{print $1}'
|
||||
- name: find loop device
|
||||
shell: losetup -a|grep '{{path}}'|awk -F':' '{print $1}'
|
||||
register: loop_device
|
||||
- name: create Volume Group on loop device
|
||||
lvg: vg={{volume_name}} pvs={% raw %}{{item}}{% endraw %} state=present
|
||||
|
Loading…
x
Reference in New Issue
Block a user