Avoid duplicate Jinja conditional block by moving service restart

This commit is contained in:
Imran Iqbal 2018-06-16 12:38:48 +01:00
parent 65683252c4
commit 79ab1a2930

View file

@ -122,7 +122,14 @@ postgresql-conf:
- file: postgresql-conf-comment-port
{%- endif %}
- watch_in:
- service: postgresql-service-restart
- module: postgresql-service-restart
# Restart the service where reloading is not sufficient
# Currently only when changes are made to `postgresql.conf`
postgresql-service-restart:
module.wait:
- name: service.restart
- m_name: {{ postgres.service }}
{%- endif %}
@ -211,12 +218,4 @@ postgresql-running:
- file: postgresql-pg_hba
- 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 %}