From 1c72c7c3a149af6c184f98e6c7eed77867fdc6d3 Mon Sep 17 00:00:00 2001 From: Jon Nelson Date: Tue, 19 Jul 2016 10:10:07 -0500 Subject: [PATCH] - for encoding, lc_type, and lc_collate, only set them on the database if they are explicitly supplied. Otherwise use the postgres database defaults. --- postgres/init.sls | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/postgres/init.sls b/postgres/init.sls index 11ae33e..25efb2c 100644 --- a/postgres/init.sls +++ b/postgres/init.sls @@ -157,9 +157,15 @@ postgresql-db-{{ name }}: {% else %} postgres_database.present: - name: {{ name }} - - encoding: {{ db.get('encoding', 'UTF8') }} - - lc_ctype: {{ db.get('lc_ctype', 'en_US.UTF8') }} - - lc_collate: {{ db.get('lc_collate', 'en_US.UTF8') }} + {% if 'encoding' in db %} + - encoding: {{ db.encoding }} + {% endif %} + {% if 'lc_ctype' in db %} + - lc_ctype: {{ db.lc_type }} + {% endif %} + {% if 'lc_collate' in db %} + - lc_collate: {{ db.lc_collate }} + {% endif %} - template: {{ db.get('template', 'template0') }} - tablespace: {{ db.get('tablespace', 'pg_default') }} {% if db.get('owner') %}