Added the ability to add custom configuration to the postgresql.conf configuration file.
This commit is contained in:
@@ -23,6 +23,19 @@ libpq-dev:
|
||||
python-dev:
|
||||
pkg.installed
|
||||
|
||||
{% if 'postgresconf' in pillar.get('postgres', {}) %}
|
||||
postgresql-conf:
|
||||
file.blockreplace:
|
||||
- name: {{ postgres.conf_dir }}/postgresql.conf
|
||||
- marker_start: "# Managed by SaltStack: listen_addresses: please do not edit"
|
||||
- marker_end: "# Managed by SaltStack: end of salt managed zone --"
|
||||
- content: {{ salt['pillar.get']('postgres:postgresconf') }}
|
||||
- show_changes: True
|
||||
- append_if_not_found: True
|
||||
- watch_in:
|
||||
- service: postgresql
|
||||
{% endif %}
|
||||
|
||||
{% if 'pg_hba.conf' in pillar.get('postgres', {}) %}
|
||||
pg_hba.conf:
|
||||
file.managed:
|
||||
@@ -38,6 +51,7 @@ pg_hba.conf:
|
||||
- service: postgresql
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if 'users' in pillar.get('postgres', {}) %}
|
||||
{% for name, user in salt['pillar.get']('postgres:users').items() %}
|
||||
postgres-user-{{ name }}:
|
||||
@@ -70,3 +84,4 @@ postgres-db-{{ name }}:
|
||||
{% endif %}
|
||||
{% endfor%}
|
||||
{% endif %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user