postgresql-server: Optionally create own LVM LV and file system
authorAlexander Barton <alex@barton.de>
Mon, 19 Feb 2018 17:11:48 +0000 (18:11 +0100)
committerAlexander Barton <alex@barton.de>
Mon, 19 Feb 2018 17:11:48 +0000 (18:11 +0100)
This was supported by the mysql-server role already, bring it in line.

roles/postgresql-server/defaults/main.yml
roles/postgresql-server/tasks/main.yml

index 33649e6..84cc0b2 100644 (file)
@@ -2,3 +2,7 @@
 # defaults file for postgresql-server
 
 postgresql_major: 9.4
+
+postgresql_server_vg: ""
+postgresql_server_lv_name: "postgresql"
+postgresql_server_lv_size: "10g"
index 5463bd4..7fc8bd8 100644 (file)
@@ -1,6 +1,18 @@
 ---
 # tasks file for postgresql-server
 
+- name: create LVM LV and file system for PostgreSQL data
+  tags:
+    - postgresql
+    - fs
+  include_role:
+    name: lvm-lv
+  vars:
+    lvm_vg: "{{ postgresql_server_vg }}"
+    lvm_lv_name: "{{ postgresql_server_lv_name }}"
+    lvm_lv_size: "{{ postgresql_server_lv_size }}"
+  when: postgresql_server_vg != ""
+
 - name: install PostgreSQL {{ postgresql_major }} packages for client and server
   tags:
     - packages