Use separate state for restarting service re: postgresql.conf

This commit is contained in:
Imran Iqbal 2018-06-12 19:52:58 +01:00
parent e1a19ed78f
commit 65683252c4

View file

@ -122,7 +122,7 @@ postgresql-conf:
- file: postgresql-conf-comment-port - file: postgresql-conf-comment-port
{%- endif %} {%- endif %}
- watch_in: - watch_in:
- service: postgresql-running - service: postgresql-service-restart
{%- endif %} {%- endif %}
@ -204,11 +204,19 @@ postgresql-running:
service.running: service.running:
- name: {{ postgres.service }} - name: {{ postgres.service }}
- enable: True - enable: True
{% if grains.os not in ('MacOS',) and not db_port %} {% if grains.os not in ('MacOS',) %}
- reload: True - reload: True
{% endif %} {% endif %}
- watch: - watch:
- file: postgresql-pg_hba - file: postgresql-pg_hba
- file: postgresql-pg_ident - file: postgresql-pg_ident
# Restart the service where reloading is not sufficient
# Currently when changes are made to `postgresql.conf`
{%- if postgres.postgresconf or db_port %}
postgresql-service-restart:
service.running:
- name: {{ postgres.service }}
{%- endif %}
{%- endif %} {%- endif %}