summaryrefslogtreecommitdiff
path: root/roles/storage/lvm/volume/tasks/main.yml
blob: 9d335285b88b255dc98bb4f74e9e957f2b3a7517 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
---
- name: create logical volume
  lvol:
    vg: "{{ lvm_volume.vg }}"
    lv: "{{ lvm_volume.lv }}"
    size: "{{ lvm_volume.size }}"

- name: create filesystem
  filesystem:
    fstype: "{{ lvm_volume.fs }}"
    dev: "/dev/mapper/{{ lvm_volume.vg | replace('-', '--') }}-{{ lvm_volume.lv | replace('-', '--') }}"

- name: mount filesytem
  mount:
    src: "/dev/mapper/{{ lvm_volume.vg | replace('-', '--') }}-{{ lvm_volume.lv | replace('-', '--') }}"
    path: "{{ lvm_volume.dest }}"
    fstype: "{{ lvm_volume.fs }}"
    state: mounted