Add nginx proxy server

This commit is contained in:
2022-06-27 20:21:25 -04:00
parent 82df91305a
commit 8362230eb4
8 changed files with 22 additions and 21 deletions

View File

@@ -1,2 +1,5 @@
postgresql_config: /etc/postgresql/13/main/pg_hba.conf
postgresql_listen: "*"
postgresql_trust:
- "172.16.0.0/12"
- "192.168.0.0/16"

View File

@@ -3,15 +3,16 @@
name: postgresql
state: present
- name: Trust connections to PostgreSQL from Docker
- name: Trust connections to PostgreSQL
postgresql_pg_hba:
dest: "{{ postgresql_config }}"
contype: host
databases: all
users: all
address: "172.16.0.0/12"
address: "{{ item }}"
method: trust
register: postgresql_hba
loop: "{{ postgresql_trust }}"
- name: Change PostgreSQL listen addresses
postgresql_set:
@@ -33,9 +34,10 @@
state: restarted
when: postgresql_config.changed
- name: Allow database connections from Docker
- name: Allow database connections
ufw:
rule: allow
port: "5432"
proto: tcp
src: "172.16.0.0/12"
src: "{{ item }}"
loop: "{{ postgresql_trust }}"