From 23e312eb3e00952345ac8d26ae72c2d500e7031d Mon Sep 17 00:00:00 2001 From: noelmcloughlin Date: Wed, 28 Mar 2018 11:28:46 +0100 Subject: [PATCH 1/4] Add client/ directory --- postgres/{client.sls => client/init.sls} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename postgres/{client.sls => client/init.sls} (100%) diff --git a/postgres/client.sls b/postgres/client/init.sls similarity index 100% rename from postgres/client.sls rename to postgres/client/init.sls From feb2b386cede1f1847e6c8f15db40ae0fb6ee111 Mon Sep 17 00:00:00 2001 From: Brian Glogower Date: Sat, 31 Mar 2018 13:03:14 -0700 Subject: [PATCH 2/4] Allow setting dir mode for conf_dir in pillar The current mode of 0775 causes start problems: `FATAL: data directory "/var/lib/postgresql/9.6/main" has group or world access` --- postgres/defaults.yaml | 1 + postgres/server/init.sls | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/postgres/defaults.yaml b/postgres/defaults.yaml index aff9607..e737366 100644 --- a/postgres/defaults.yaml +++ b/postgres/defaults.yaml @@ -21,6 +21,7 @@ postgres: env: [] conf_dir: /var/lib/pgsql/data + conf_dir_mode: 0775 postgresconf: "" macos: diff --git a/postgres/server/init.sls b/postgres/server/init.sls index 6e2b23b..daf9d1b 100644 --- a/postgres/server/init.sls +++ b/postgres/server/init.sls @@ -72,7 +72,7 @@ postgresql-config-dir: - name: {{ postgres.conf_dir }} - user: {{ postgres.user }} - group: {{ postgres.group }} - - dir_mode: 775 + - dir_mode: {{ postgres.conf_dir_mode }} - force: True - file_mode: 644 - recurse: From 9b289b84026b9b042b947d0dd9b7a1d82e84ced2 Mon Sep 17 00:00:00 2001 From: noelmcloughlin Date: Mon, 9 Apr 2018 15:50:17 +0100 Subject: [PATCH 3/4] Convert hex to decimal --- postgres/defaults.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postgres/defaults.yaml b/postgres/defaults.yaml index e737366..2e17dd8 100644 --- a/postgres/defaults.yaml +++ b/postgres/defaults.yaml @@ -21,7 +21,7 @@ postgres: env: [] conf_dir: /var/lib/pgsql/data - conf_dir_mode: 0775 + conf_dir_mode: '0775' postgresconf: "" macos: From 15f3d5f5b46a5a495787862d095b186b66563d18 Mon Sep 17 00:00:00 2001 From: Denys Havrysh Date: Wed, 11 Apr 2018 16:43:11 +0300 Subject: [PATCH 4/4] Fix compatibility with Salt 2018.3.0 --- postgres/server/init.sls | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/postgres/server/init.sls b/postgres/server/init.sls index daf9d1b..da744fa 100644 --- a/postgres/server/init.sls +++ b/postgres/server/init.sls @@ -114,7 +114,7 @@ postgresql-pg_hba: - source: {{ postgres['pg_hba.conf'] }} - template: jinja - defaults: - acls: {{ postgres.acls }} + acls: {{ postgres.acls|yaml() }} {%- if postgres.config_backup %} # Create the empty file before managing to overcome the limitation of check_cmd - onlyif: test -f {{ pg_hba_path }} || touch {{ pg_hba_path }} @@ -141,7 +141,7 @@ postgresql-pg_ident: - source: {{ postgres['pg_ident.conf'] }} - template: jinja - defaults: - mappings: {{ postgres.identity_map }} + mappings: {{ postgres.identity_map|yaml() }} {%- if postgres.config_backup %} # Create the empty file before managing to overcome the limitation of check_cmd - onlyif: test -f {{ pg_ident_path }} || touch {{ pg_ident_path }}