Skip to content

Commit bd810f9

Browse files
Merge pull request #1 from grim-fendango/make-exposure-to-host-configurable
Access to the database from the host is now configurable via the role…
2 parents 13cead2 + bcf55a2 commit bd810f9

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

defaults/main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ postgresql:
1111
ssl: true
1212
timezone: "UTC"
1313
version: 9.5
14+
expose_to_host: false
1415

1516
service:
1617
state: started

templates/pg_hba.conf.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ local all postgres trust
66
local all all peer
77
host all all 127.0.0.1/32 md5
88
host all all ::1/128 md5
9-
{% if group_env == 'local' %}host all all 0.0.0.0/0 trust{% endif %}
9+
{% if postgresql.expose_to_host == true %}host all all all trust{% endif %}

templates/postgresql.conf.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ident_file = '/etc/postgresql/{{ postgresql.version }}/main/pg_ident.conf'
77

88
external_pid_file = '/var/run/postgresql/{{ postgresql.version }}-main.pid'
99

10-
{% if group_env == 'local' %}
10+
{% if postgresql.expose_to_host == true %}
1111
listen_addresses = '*'
1212
{% endif %}
1313

0 commit comments

Comments
 (0)