Skip to content

Commit 847738c

Browse files
Merge pull request #34 from A1EF/master
Restart `exim4` only when config changes
2 parents 973f85c + 2552739 commit 847738c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

salt/exim/init.sls

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ exim4_service:
2828
service.running:
2929
- name: exim4
3030
- enable: True
31-
31+
- watch:
32+
- file: /etc/exim4/*
3233

3334
create_dir_dkim:
3435
file.directory:
@@ -43,12 +44,14 @@ create_dir_dkim:
4344
generate_private_cert:
4445
cmd.run:
4546
- name: openssl genrsa -out {{ pillar['dkim_private_key'] }} 1024
47+
- runas: Debian-exim
4648
- cwd: /etc/exim4/dkim/
4749
- creates: /etc/exim4/dkim/{{ pillar['dkim_private_key'] }}
4850

4951
generate_public_cert:
5052
cmd.run:
5153
- name: openssl rsa -pubout -in {{ pillar['dkim_private_key'] }} -out {{ pillar['dkim_public_key'] }}
54+
- runas: Debian-exim
5255
- cwd: /etc/exim4/dkim/
5356
- creates: /etc/exim4/dkim/{{ pillar['dkim_public_key'] }}
5457

@@ -80,7 +83,3 @@ exim4_config_localmail:
8083
- mode: replace
8184
- content: 'domainlist local_domains = localhost : localhost.localdomain'
8285
- match: 'domainlist local_domains = MAIN_LOCAL_DOMAINS'
83-
84-
restart_exim:
85-
cmd.run:
86-
- name: service exim4 restart

0 commit comments

Comments
 (0)