Переглянути джерело

[postgres] Fix permissions and patches

Colin Powell 4 роки тому
батько
коміт
0f4c7f17db

+ 6 - 2
ansible/hosts

@@ -8,9 +8,10 @@ janus.local
 rhea.local
 
 [jails]
+db.local
 mail.local
+jump.local ansible_become=true
 git.local
-jump.local
 logging.local
 matrix.local
 pbp.local
@@ -60,7 +61,7 @@ fifteen5.local
 [gitea]
 git.local
 
-[ssh]
+[jump]
 jump.local
 
 [proxy]
@@ -86,3 +87,6 @@ pbp.local
 
 [fifteen5]
 fifteen5.local
+
+[pgadmin]
+db.local

+ 9 - 0
ansible/playbook.yml

@@ -1,4 +1,12 @@
 ---
+- hosts: jails
+  roles:
+    - role: avahi
+
+- hosts: pgadmin
+  roles:
+    - role: pgadmin4
+
 - hosts: proxy
   roles:
     - role: caddy
@@ -9,4 +17,5 @@
 
 - hosts: fifteen5
   roles:
+    - role: postgres
     - role: fifteen5

+ 4 - 4
ansible/roles/postgres/files/pg_hba.conf.patch

@@ -1,7 +1,7 @@
-@@ -91,0 +91,0 @@
-local   replication     all                                     trust
-host    replication     all             127.0.0.1/32            trust
-host    replication     all             ::1/128                 trust
+@@ -91,3 +91,7 @@
+ local   replication     all                                     trust
+ host    replication     all             127.0.0.1/32            trust
+ host    replication     all             ::1/128                 trust
 +
 +# All IPv4 and IPv6 connections allowed and trusted (don't run this on an IP oustide the local net
 +host    all             all             0.0.0.0/0               trust

+ 2 - 0
ansible/roles/postgres/tasks/main.yml

@@ -14,10 +14,12 @@
   patch:
     src: pg_hba.conf.patch
     dest: /var/db/postgres/data12/pg_hba.conf
+  become_user: postgres
   notify: PostgreSQL restarted
 
 - name: PostgreSQL config file patched
   patch:
     src: postgresql.conf.patch
     dest: /var/db/postgres/data12/postgresql.conf
+  become_user: postgres
   notify: PostgreSQL restarted