xoxys.mongodb/tasks/storage.yml

27 lines
812 B
YAML
Raw Normal View History

2018-07-07 21:29:34 +00:00
---
- block:
2018-07-07 21:51:58 +00:00
- name: Create volume group '{{ mongodb_lvm_vg }}'
2018-07-07 21:29:34 +00:00
lvg:
vg: "{{ mongodb_lvm_vg }}"
pvs: "{{ mongodb_lvm_pvs|join(',') }}"
2018-07-07 21:51:58 +00:00
- name: Create logical volume '{{ mongodb_lvm_lv }}'
2018-07-07 21:29:34 +00:00
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 }}"
2018-07-07 23:16:16 +00:00
resizefs: True
2018-07-07 21:29:34 +00:00
2018-07-07 21:51:58 +00:00
- name: Mount volume to '{{ mongodb_storage_dbpath }}'
2018-07-07 21:29:34 +00:00
mount:
path: "{{ mongodb_storage_dbpath }}"
src: "/dev/mapper/{{ mongodb_lvm_vg }}-{{ mongodb_lvm_lv }}"
fstype: "{{ mongodb_lvm_fstype }}"
state: mounted
become: True