xoxys.mongodb/tasks/storage.yml
Robert Kaussow a3880a4698
Some checks failed
continuous-integration/drone/push Build is failing
fix ansible guideine errors
2019-01-12 14:40:16 +01:00

28 lines
872 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
become_user: root