Page MenuHomeDevCentral

D2865.id7298.diff
No OneTemporary

D2865.id7298.diff

diff --git a/pillar/paas/docker.sls b/pillar/paas/docker.sls
--- a/pillar/paas/docker.sls
+++ b/pillar/paas/docker.sls
@@ -209,6 +209,8 @@
postgresql:
sentry_db:
+ image: nasqueron/postgres-sentry
+ pg_hba: salt://roles/paas-docker/containers/files/sentry/pg_hba.conf
credential: nasqueron.sentry.postgresql
memcached:
diff --git a/roles/paas-docker/containers/files/sentry/pg_hba.conf b/roles/paas-docker/containers/files/sentry/pg_hba.conf
new file mode 100644
--- /dev/null
+++ b/roles/paas-docker/containers/files/sentry/pg_hba.conf
@@ -0,0 +1,25 @@
+# -------------------------------------------------------------
+# PostgreSQL — Client authentication configuration file
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Scope: Sentry
+# License: Trivial work, not eligible to copyright
+# Description: Allow standard PostgreSQL Docker image
+# client authentication, and replication.
+# Reference: https://www.postgresql.org/docs/9.6/auth-pg-hba-conf.html
+# -------------------------------------------------------------
+
+# TYPE DATABASE USER ADDRESS METHOD
+
+# "local" is for Unix domain socket connections only
+local all all trust
+
+# IPv4 and IPv6 local connections
+host all all 127.0.0.1/32 trust
+host all all ::1/128 trust
+
+# Standard user connections
+host all all all md5
+
+# Replication
+host replication all all md5
diff --git a/roles/paas-docker/containers/postgresql.sls b/roles/paas-docker/containers/postgresql.sls
--- a/roles/paas-docker/containers/postgresql.sls
+++ b/roles/paas-docker/containers/postgresql.sls
@@ -22,6 +22,14 @@
- group: 999
- makedirs: True
+{% if "pg_hba" in container %}
+/srv/{{ instance }}/postgresql/pg_hba.conf:
+ file.managed:
+ - source: {{ container["pg_hba"] }}
+ - user: 999
+ - group: 999
+{% endif %}
+
{% if has_selinux %}
selinux_context_{{ instance }}_postgresql_data:

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 12:46 (8 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2260181
Default Alt Text
D2865.id7298.diff (2 KB)

Event Timeline