xoxys.matrix/tasks/storage.yml
2019-01-18 14:52:23 +01:00

28 lines
845 B
YAML

---
- block:
- name: Create volume group '{{ matrix_lvm_vg }}'
lvg:
vg: "{{ matrix_lvm_vg }}"
pvs: "{{ matrix_lvm_pvs | join(',') }}"
- name: Create logical volume '{{ matrix_lvm_lv }}'
lvol:
vg: "{{ matrix_lvm_vg }}"
lv: "{{ matrix_lvm_lv }}"
size: "{{ matrix_lvm_size }}"
- name: Create filesystem for '/dev/mapper/{{ matrix_lvm_vg }}-{{ matrix_lvm_lv }}'
filesystem:
fstype: "{{ matrix_lvm_fstype }}"
dev: "/dev/mapper/{{ matrix_lvm_vg }}-{{ matrix_lvm_lv }}"
resizefs: True
- name: Mount volume to '{{ matrix_base_dir }}'
mount:
path: "{{ matrix_base_dir }}"
src: "/dev/mapper/{{ matrix_lvm_vg }}-{{ matrix_lvm_lv }}"
fstype: "{{ matrix_lvm_fstype }}"
state: mounted
become: True
become_user: root