Emmanuel Bouthenot пре 10 година
родитељ
комит
26991c18e8

+ 3 - 0
roles/dbserver/defaults/main.yml

@@ -6,4 +6,7 @@ with_mysql: False
 with_mysql_backup: True
 mysql_root_password: Null
 
+with_postgresql: False
+with_postgresql_backup: True
+
 # vim: ft=yaml

+ 1 - 0
roles/dbserver/tasks/main.yml

@@ -1 +1,2 @@
 - include: mysql.yml
+- include: postgresql.yml

+ 14 - 0
roles/dbserver/tasks/postgresql.yml

@@ -0,0 +1,14 @@
+- name: Install PostgreSQL server related packages
+  apt: pkg={{ item }} state=installed update_cache=yes
+  with_items:
+    - postgresql
+    - postgresql-client
+  when: with_postgresql
+
+- name: Install PostgreSQL backup related packages (autopostgresqlbackup)
+  apt: pkg=autopostgresqlbackup state=installed update_cache=yes
+  when: with_postgresql and with_postgresql_backup
+
+- name: Ensure PostgreSQL server is running
+  service: name=postgresql state=started
+  when: with_postgresql