xoxys.postgres/tasks/storage.yml
Robert Kaussow 6b1a32dbfd
All checks were successful
continuous-integration/drone/push Build is passing
add pesize to lvm to fix ansible warning
2019-06-30 17:00:25 +02:00

37 lines
1.1 KiB
YAML

---
- block:
- name: Setup base folder and set permissions
file:
path: "{{ postgres_base_dir }}"
state: directory
owner: "{{ postgres_user }}"
group: "{{ postgres_group }}"
mode: 0700
- name: Create volume group '{{ postgres_lvm_vg }}'
lvg:
vg: "{{ postgres_lvm_vg }}"
pvs: "{{ postgres_lvm_pvs | join(',') }}"
pesize: "4"
- name: Create logical volume '{{ postgres_lvm_lv }}'
lvol:
vg: "{{ postgres_lvm_vg }}"
lv: "{{ postgres_lvm_lv }}"
size: "{{ postgres_lvm_size }}"
- name: Create filesystem for '/dev/mapper/{{ postgres_lvm_vg }}-{{ postgres_lvm_lv }}'
filesystem:
fstype: "{{ postgres_lvm_fstype }}"
dev: "/dev/mapper/{{ postgres_lvm_vg }}-{{ postgres_lvm_lv }}"
resizefs: True
- name: Mount volume to '{{ postgres_base_dir }}'
mount:
path: "{{ postgres_base_dir }}"
src: "/dev/mapper/{{ postgres_lvm_vg }}-{{ postgres_lvm_lv }}"
fstype: "{{ postgres_lvm_fstype }}"
state: mounted
become: True
become_user: root