Skip to content

Commit 0f1ad60

Browse files
authored
Merge pull request #94 from alxwr/service-restart
fix(service): restart service on package change
2 parents fb18252 + 75358e0 commit 0f1ad60

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

postfix/init.sls

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ postfix:
1717
- watch:
1818
- pkg: postfix
1919
20+
{%- if salt['pillar.get']('postfix:reload_service', True) %}
21+
# Restart postfix if the package was changed.
22+
# This also provides an ID to be used in a watch_in statement.
23+
postfix_service_restart:
24+
service.running:
25+
- name: postfix
26+
- watch:
27+
- pkg: postfix
28+
{%- endif %}
29+
2030
{# Used for newaliases, postalias and postconf #}
2131
{%- set default_database_type = salt['pillar.get']('postfix:config:default_database_type', 'hash') %}
2232

0 commit comments

Comments
 (0)