2
2
include:
3
3
- postfix
4
4
5
- {{ postfix.config_path }} :
5
+ postfix- config - file - directory - config - path :
6
6
file .directory:
7
+ - name: {{ postfix.config_path }}
7
8
- user: root
8
9
- group: {{ postfix.root_grp }}
9
10
- dir_mode: ' 0755'
10
11
- file_mode: ' 0644'
11
12
- makedirs: True
12
13
13
- {{ postfix.config_path }} / main.cf:
14
+ postfix- config - file - managed - main.cf:
14
15
file .managed:
16
+ - name: {{ postfix.config_path }}/ main.cf
15
17
- source: salt:// postfix/ files/ main.cf
16
18
- user: root
17
19
- group: {{ postfix.root_grp }}
18
20
- mode: ' 0644'
19
21
- require:
20
- - pkg: postfix
22
+ - pkg: postfix- init - pkg - installed - postfix
21
23
- watch_in:
22
- - service: postfix
24
+ - service: postfix- init - service - running - postfix
23
25
- template: jinja
24
26
- context:
25
27
postfix: {{ postfix| tojson }}
26
28
27
29
{% if ' vmail' in pillar.get(' postfix' , ' ' ) % }
28
- {{ postfix.config_path }} / virtual_alias_maps .cf:
30
+ postfix- config - file - managed - virtual - alias - maps .cf:
29
31
file .managed:
32
+ - name: {{ postfix.config_path }}/ virtual_alias_maps.cf
30
33
- source: salt:// postfix/ files/ virtual_alias_maps.cf
31
34
- user: root
32
35
- group: postfix
33
36
- mode: ' 0640'
34
37
- require:
35
- - pkg: postfix
38
+ - pkg: postfix- init - pkg - installed - postfix
36
39
- watch_in:
37
- - service: postfix
40
+ - service: postfix- init - service - running - postfix
38
41
- template: jinja
39
42
40
- {{ postfix.config_path }} / virtual_mailbox_domains .cf:
43
+ postfix- config - file - managed - virtual - mailbox - domains .cf:
41
44
file .managed:
45
+ - name: {{ postfix.config_path }}/ virtual_mailbox_domains.cf
42
46
- source: salt:// postfix/ files/ virtual_mailbox_domains.cf
43
47
- user: root
44
48
- group: postfix
45
49
- mode: ' 0640'
46
50
- require:
47
- - pkg: postfix
51
+ - pkg: postfix- init - pkg - installed - postfix
48
52
- watch_in:
49
- - service: postfix
53
+ - service: postfix- init - service - running - postfix
50
54
- template: jinja
51
55
52
- {{ postfix.config_path }} / virtual_mailbox_maps .cf:
56
+ postfix- config - file - managed - virtual - mailbox - maps .cf:
53
57
file .managed:
58
+ - name: {{ postfix.config_path }}/ virtual_mailbox_maps.cf
54
59
- source: salt:// postfix/ files/ virtual_mailbox_maps.cf
55
60
- user: root
56
61
- group: postfix
57
62
- mode: ' 0640'
58
63
- require:
59
- - pkg: postfix
64
+ - pkg: postfix- init - pkg - installed - postfix
60
65
- watch_in:
61
- - service: postfix
66
+ - service: postfix- init - service - running - postfix
62
67
- template: jinja
63
68
{% endif % }
64
69
65
70
{% if salt[' pillar.get' ](' postfix:manage_master_config' , True ) % }
66
71
{% import_yaml " postfix/services.yaml" as postfix_master_services % }
67
- {{ postfix.config_path }} / master.cf:
72
+ postfix- config - file - managed - master.cf:
68
73
file .managed:
74
+ - name: {{ postfix.config_path }}/ master.cf
69
75
- source: salt:// postfix/ files/ master.cf
70
76
- user: root
71
77
- group: {{ postfix.root_grp }}
72
78
- mode: ' 0644'
73
79
- require:
74
- - pkg: postfix
80
+ - pkg: postfix- init - pkg - installed - postfix
75
81
- watch_in:
76
- - service: postfix
82
+ - service: postfix- init - service - running - postfix
77
83
- template: jinja
78
84
- context:
79
85
postfix: {{ postfix| tojson }}
@@ -82,23 +88,22 @@ include:
82
88
83
89
{%- for domain in salt[' pillar.get' ](' postfix:certificates' , {}).keys() % }
84
90
85
- postfix_{{ domain }}_ssl_certificate:
86
-
91
+ postfix- config- file - managed- {{ domain }}- ssl- certificate:
87
92
file .managed:
88
93
- name: {{ postfix.config_path }}/ ssl/ {{ domain }}.crt
89
94
- makedirs: True
90
95
- contents_pillar: postfix:certificates:{{ domain }}:public_cert
91
96
- watch_in:
92
- - service: postfix
97
+ - service: postfix- init - service - running - postfix
93
98
94
- postfix_ {{ domain }}_ssl_key :
99
+ postfix - config - file - managed - {{ domain }}- ssl - key :
95
100
file .managed:
96
101
- name: {{ postfix.config_path }}/ ssl/ {{ domain }}.key
97
102
- mode: ' 0600'
98
103
- makedirs: True
99
104
- contents_pillar: postfix:certificates:{{ domain }}:private_key
100
105
- watch_in:
101
- - service: postfix
106
+ - service: postfix- init - service - running - postfix
102
107
103
108
{% endfor % }
104
109
@@ -120,7 +125,7 @@ postfix_{{ domain }}_ssl_key:
120
125
{%- if file_type in (" btree" , " cdb" , " cidr" , " dbm" , " hash" , " pcre" , " regexp" , " sdbm" ) % }
121
126
{%- set need_postmap = True % }
122
127
{%- endif % }
123
- postfix_ {{ mapping }}:
128
+ postfix - config - file - managed - {{ mapping }}:
124
129
file .managed:
125
130
- name: {{ file_path }}
126
131
- source: salt:// postfix/ files/ mapping.j2
@@ -135,15 +140,16 @@ postfix_{{ mapping }}:
135
140
- context:
136
141
data: {{ data| json() }}
137
142
- require:
138
- - pkg: postfix
139
- - file : {{ postfix.config_path }} / main.cf
143
+ - pkg: postfix- init - pkg - installed - postfix
144
+ - file : postfix- config - file - managed - main.cf
140
145
{%- if need_postmap % }
146
+ postfix- config- cmd- wait- {{ mapping }}:
141
147
cmd.wait:
142
148
- name: {{ postfix.xbin_prefix }}/ sbin/ postmap {{ file_path }}
143
149
- cwd: /
144
150
- watch:
145
- - file : {{ file_path }}
151
+ - file : postfix - config - file - managed - {{ mapping }}
146
152
- watch_in:
147
- - service: postfix
153
+ - service: postfix- init - service - running - postfix
148
154
{%- endif % }
149
155
{% endfor % }
0 commit comments