xoxys.mongodb/tasks/storage.yml
2018-07-08 01:16:16 +02:00

27 lines
812 B
YAML

---
- block:
- name: Create volume group '{{ mongodb_lvm_vg }}'
lvg:
vg: "{{ mongodb_lvm_vg }}"
pvs: "{{ mongodb_lvm_pvs|join(',') }}"
- name: Create logical volume '{{ mongodb_lvm_lv }}'
lvol:
vg: "{{ mongodb_lvm_vg }}"
lv: "{{ mongodb_lvm_lv }}"
size: "{{ mongodb_lvm_size }}"
- name: Create filesystem for '/dev/mapper/{{ mongodb_lvm_vg }}-{{ mongodb_lvm_lv }}'
filesystem:
fstype: "{{ mongodb_lvm_fstype }}"
dev: "/dev/mapper/{{ mongodb_lvm_vg }}-{{ mongodb_lvm_lv }}"
resizefs: True
- name: Mount volume to '{{ mongodb_storage_dbpath }}'
mount:
path: "{{ mongodb_storage_dbpath }}"
src: "/dev/mapper/{{ mongodb_lvm_vg }}-{{ mongodb_lvm_lv }}"
fstype: "{{ mongodb_lvm_fstype }}"
state: mounted
become: True