xoxys.mongodb/tasks/storage.yml

28 lines
872 B
YAML
Raw Normal View History

2018-07-07 21:29:34 +00:00
---
- block:
2019-01-12 13:40:16 +00:00
- name: Create volume group '{{ mongodb_lvm_vg }}'
lvg:
vg: "{{ mongodb_lvm_vg }}"
pvs: "{{ mongodb_lvm_pvs|join(',') }}"
2018-07-07 21:29:34 +00:00
2019-01-12 13:40:16 +00:00
- name: Create logical volume '{{ mongodb_lvm_lv }}'
lvol:
vg: "{{ mongodb_lvm_vg }}"
lv: "{{ mongodb_lvm_lv }}"
size: "{{ mongodb_lvm_size }}"
2018-07-07 21:29:34 +00:00
2019-01-12 13:40:16 +00:00
- 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
2018-07-07 21:29:34 +00:00
2019-01-12 13:40:16 +00:00
- 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
2018-07-07 21:29:34 +00:00
become: True
2019-01-12 13:40:16 +00:00
become_user: root