fix(service): restart service on package change

This also provides an ID to be used in a watch_in statement.
This commit is contained in:
Alexander Weidinger 2019-07-25 22:15:55 +02:00
parent fb182529e4
commit 75358e03e0

View File

@ -17,6 +17,16 @@ postfix:
- watch: - watch:
- pkg: postfix - pkg: postfix
{%- if salt['pillar.get']('postfix:reload_service', True) %}
# Restart postfix if the package was changed.
# This also provides an ID to be used in a watch_in statement.
postfix_service_restart:
service.running:
- name: postfix
- watch:
- pkg: postfix
{%- endif %}
{# Used for newaliases, postalias and postconf #} {# Used for newaliases, postalias and postconf #}
{%- set default_database_type = salt['pillar.get']('postfix:config:default_database_type', 'hash') %} {%- set default_database_type = salt['pillar.get']('postfix:config:default_database_type', 'hash') %}