diff --git a/defaults/main.yml b/defaults/main.yml index 3a927cd..4e550f9 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -5,15 +5,6 @@ postgres_repository_filename: "Postgresql-{{ postgres_version | regex_replace('\ postgres_user: postgres postgres_group: postgres -postgres_lvm_enabled: False -# This variables are only necessary if postgres_lvm_enabled is 'True' -# Set physical volumes to use in LVM -# postgres_lvm_pvs: # ['/dev/sdb', '/dev/sdc'] -# postgres_lvm_vg: # "vg_postgres" -# postgres_lvm_lv: # "lv_postgres" -# postgres_lvm_fstype: # "ext4" -# postgres_lvm_size: # "50G" - # @var postgres_base_dir: $ "_os-default_" postgres_log_destination: diff --git a/tasks/main.yml b/tasks/main.yml index d1a170d..ed9d4e5 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,7 +1,5 @@ --- - import_tasks: prepare.yml -- import_tasks: storage.yml - when: postgres_lvm_enabled | bool - import_tasks: install.yml - import_tasks: config.yml - import_tasks: tls.yml diff --git a/tasks/storage.yml b/tasks/storage.yml deleted file mode 100644 index 433aa33..0000000 --- a/tasks/storage.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -- 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