Merge pull request #94 from alxwr/service-restart

fix(service): restart service on package change
This commit is contained in:
Niels Abspoel 2019-07-26 22:06:42 +02:00 committed by GitHub
commit 0f1ad60500
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -17,6 +17,16 @@ postfix:
- watch:
- 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 #}
{%- set default_database_type = salt['pillar.get']('postfix:config:default_database_type', 'hash') %}