From 6b38fd0866ed3e95ea05fe74533f6e52e857713c Mon Sep 17 00:00:00 2001 From: Noel McLoughin Date: Tue, 16 Jan 2018 12:57:28 +0000 Subject: [PATCH 1/3] Set env=None if cmd.run.env dict is empty --- postgres/server/init.sls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postgres/server/init.sls b/postgres/server/init.sls index 5610e657..987930ab 100644 --- a/postgres/server/init.sls +++ b/postgres/server/init.sls @@ -56,7 +56,7 @@ postgresql-cluster-prepared: - name: {{ postgres.prepare_cluster.command }} - cwd: / - runas: {{ postgres.prepare_cluster.user }} - - env: {{ postgres.prepare_cluster.env|default({}) }} + - env: {{ postgres.prepare_cluster.env|default({}) or None }} - unless: - {{ postgres.prepare_cluster.test }} - require: From af9e4fbf886be157f37451da248e0979e73a877a Mon Sep 17 00:00:00 2001 From: Noel McLoughin Date: Fri, 19 Jan 2018 17:15:01 +0000 Subject: [PATCH 2/3] PR comments implemented. --- postgres/defaults.yaml | 3 ++- postgres/server/init.sls | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/postgres/defaults.yaml b/postgres/defaults.yaml index 50f9acc8..9f99e9b3 100644 --- a/postgres/defaults.yaml +++ b/postgres/defaults.yaml @@ -16,7 +16,8 @@ postgres: command: initdb --pgdata=/var/lib/pgsql/data test: test -f /var/lib/pgsql/data/PG_VERSION user: postgres - env: {} + # Be aware that there's no ``None`` value exists in YAML + env: Null conf_dir: /var/lib/pgsql/data postgresconf: "" diff --git a/postgres/server/init.sls b/postgres/server/init.sls index 987930ab..d0d60a36 100644 --- a/postgres/server/init.sls +++ b/postgres/server/init.sls @@ -56,7 +56,7 @@ postgresql-cluster-prepared: - name: {{ postgres.prepare_cluster.command }} - cwd: / - runas: {{ postgres.prepare_cluster.user }} - - env: {{ postgres.prepare_cluster.env|default({}) or None }} + - env: {{ postgres.prepare_cluster.env }} - unless: - {{ postgres.prepare_cluster.test }} - require: From e03de514023b0880ad7d55c9fc202f193bdbd19c Mon Sep 17 00:00:00 2001 From: Noel McLoughin Date: Mon, 22 Jan 2018 09:01:56 +0000 Subject: [PATCH 3/3] Use [] (list) not {} (dict) in defaults.yaml --- postgres/defaults.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postgres/defaults.yaml b/postgres/defaults.yaml index 9f99e9b3..a01bba86 100644 --- a/postgres/defaults.yaml +++ b/postgres/defaults.yaml @@ -17,7 +17,7 @@ postgres: test: test -f /var/lib/pgsql/data/PG_VERSION user: postgres # Be aware that there's no ``None`` value exists in YAML - env: Null + env: [] conf_dir: /var/lib/pgsql/data postgresconf: ""