diff --git a/pillar.example b/pillar.example index 3f34787..3e5f21d 100644 --- a/pillar.example +++ b/pillar.example @@ -71,6 +71,9 @@ postgres: # optional extensions to enable on database extensions: postgis: + # backup extension defaults to .bak if postgresconf_backup is True. + # Set to False to stop creation of backup on postgresql.conf changes. + postgresconf_backup: True # This section will append your configuration to postgresql.conf. postgresconf: | listen_addresses = 'localhost,*' diff --git a/postgres/defaults.yaml b/postgres/defaults.yaml index 68be623..2d0013a 100644 --- a/postgres/defaults.yaml +++ b/postgres/defaults.yaml @@ -15,6 +15,7 @@ postgres: acls: [] databases: {} tablespaces: {} + postgresconf_backup: True postgresconf: "" pg_hba.conf: salt://postgres/pg_hba.conf commands: diff --git a/postgres/init.sls b/postgres/init.sls index 92432b4..74d44e9 100644 --- a/postgres/init.sls +++ b/postgres/init.sls @@ -59,6 +59,9 @@ postgresql-conf: {{ postgres.postgresconf|indent(8) }} - show_changes: True - append_if_not_found: True + {% if not postgres.postgresconf_backup|default(True) -%} + - backup: False + {% endif -%} - watch_in: - service: run-postgresql {% endif %}