29 lines
894 B
YAML
29 lines
894 B
YAML
---
|
|
- block:
|
|
- name: Create volume group '{{ mongodb_lvm_vg }}'
|
|
lvg:
|
|
vg: "{{ mongodb_lvm_vg }}"
|
|
pvs: "{{ mongodb_lvm_pvs | join(',') }}"
|
|
pesize: "4"
|
|
|
|
- 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
|