Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zaxos committed May 12, 2017
1 parent 2b48878 commit 276b3bf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions tasks/create-lvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
command: "parted /dev/{{ item.disk }} --script mklabel gpt mkpart primary 0% 100% set 1 lvm on"
with_items: "{{ lvm_volumes }}"
when: >
'{{ item.disk }}1' not in lsblk_list.stdout and
'{{ item.vg_name }}-{{ item.lv_name }}' not in lsblk_list.stdout and
item.disk + "1" not in lsblk_list.stdout and
item.vg_name + "-" + item.lv_name not in lsblk_list.stdout and
(item.state is not defined or item.state == "present") and
(item.create_partition is defined and item.create_partition)
Expand All @@ -18,7 +18,7 @@
with_items: "{{ lvm_volumes }}"
when: >
(item.state is not defined or item.state == "present") and
'{{ item.vg_name }}-{{ item.lv_name }}' not in lsblk_list.stdout
item.vg_name + "-" + item.lv_name not in lsblk_list.stdout
- name: Create logical volume
lvol:
Expand Down
8 changes: 4 additions & 4 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@

- name: Create lvm volume(s)
include: create-lvm.yml
when: "{{ lvm_volumes }}"
when: lvm_volumes

- name: Mount lvm volume(s)
include: mount-lvm.yml
when: "{{ lvm_volumes }}"
when: lvm_volumes

- name: Unmount lvm volume(s)
include: unmount-lvm.yml
when: "{{ lvm_volumes }}"
when: lvm_volumes

- name: Remove lvm volume(s)
include: remove-lvm.yml
when: "{{ lvm_volumes }}"
when: lvm_volumes
2 changes: 1 addition & 1 deletion tasks/remove-lvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
command: "parted /dev/{{ item.disk }} rm 1"
with_items: "{{ lvm_volumes }}"
when: >
'{{ item.disk }}1' in lsblk_list.stdout and
item.disk + "1" in lsblk_list.stdout and
(item.state is defined and item.state == "absent") and
(item.create_partition is defined and item.create_partition)

0 comments on commit 276b3bf

Please sign in to comment.