summaryrefslogtreecommitdiff
path: root/roles/storage/lvm/base/tasks/main.yml
blob: 04d44ad05ead2323876b3fe04299636a2eb36198 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
---
- name: create lvm volume groups
  loop: "{{ lvm_groups | dict2items }}"
  loop_control:
    label: "{{ item.key }}"
  lvg:
    vg: "{{ item.key }}"
    vg_options: "{{ item.value.options | default(omit) }}"
    pvs: "{{ item.value.pvs }}"
    pesize: "{{ item.value.pesize | default(omit) }}"
    pv_options: "{{ item.value.pv_options | default(omit) }}"
    state: present

- name: create lvm devices
  loop: "{{ lvm_devices | lvm_device_list }}"
  loop_control:
    label: "{{ item.name }}"
  vars:
    lvm_device: "{{ item.device }}"
  include_role:
    name: storage/lvm/device

- name: create lvm volumes
  loop: "{{ lvm_volumes | dict2items }}"
  loop_control:
    label: "{{ item.key }}"
  vars:
    lvm_volume: "{{ item.value }}"
  include_role:
    name: storage/lvm/volume