xoxys.unifi/tasks/prepare_storage.yml

27 lines
766 B
YAML
Raw Normal View History

2018-07-08 18:50:35 +02:00
---
- block:
- name: Create volume group '{{ unifi_lvm_vg }}'
lvg:
vg: "{{ unifi_lvm_vg }}"
pvs: "{{ unifi_lvm_pvs|join(',') }}"
- name: Create logical volume '{{ unifi_lvm_lv }}'
lvol:
vg: "{{ unifi_lvm_vg }}"
lv: "{{ unifi_lvm_lv }}"
size: "{{ unifi_lvm_size }}"
- name: Create filesystem for '/dev/mapper/{{ unifi_lvm_vg }}-{{ unifi_lvm_lv }}'
filesystem:
fstype: "{{ unifi_lvm_fstype }}"
dev: "/dev/mapper/{{ unifi_lvm_vg }}-{{ unifi_lvm_lv }}"
resizefs: True
2018-07-08 19:55:44 +02:00
- name: Mount volume to '{{ unifi_base_dir }}'
2018-07-08 18:50:35 +02:00
mount:
2018-07-08 19:55:44 +02:00
path: "{{ unifi_base_dir }}"
2018-07-08 18:50:35 +02:00
src: "/dev/mapper/{{ unifi_lvm_vg }}-{{ unifi_lvm_lv }}"
fstype: "{{ unifi_lvm_fstype }}"
state: mounted
become: True