22include:
33 - postfix
44
5- {{ postfix.config_path }} :
5+ postfix- config - file - directory - config - path :
66 file .directory:
7+ - name: {{ postfix.config_path }}
78 - user: root
89 - group: {{ postfix.root_grp }}
910 - dir_mode: ' 0755'
1011 - file_mode: ' 0644'
1112 - makedirs: True
1213
13- {{ postfix.config_path }} / main.cf:
14+ postfix- config - file - managed - main.cf:
1415 file .managed:
16+ - name: {{ postfix.config_path }}/ main.cf
1517 - source: salt:// postfix/ files/ main.cf
1618 - user: root
1719 - group: {{ postfix.root_grp }}
1820 - mode: ' 0644'
1921 - require:
20- - pkg: postfix
22+ - pkg: postfix- init - pkg - installed - postfix
2123 - watch_in:
22- - service: postfix
24+ - service: postfix- init - service - running - postfix
2325 - template: jinja
2426 - context:
2527 postfix: {{ postfix| tojson }}
2628
2729{% if ' vmail' in pillar.get(' postfix' , ' ' ) % }
28- {{ postfix.config_path }} / virtual_alias_maps .cf:
30+ postfix- config - file - managed - virtual - alias - maps .cf:
2931 file .managed:
32+ - name: {{ postfix.config_path }}/ virtual_alias_maps.cf
3033 - source: salt:// postfix/ files/ virtual_alias_maps.cf
3134 - user: root
3235 - group: postfix
3336 - mode: ' 0640'
3437 - require:
35- - pkg: postfix
38+ - pkg: postfix- init - pkg - installed - postfix
3639 - watch_in:
37- - service: postfix
40+ - service: postfix- init - service - running - postfix
3841 - template: jinja
3942
40- {{ postfix.config_path }} / virtual_mailbox_domains .cf:
43+ postfix- config - file - managed - virtual - mailbox - domains .cf:
4144 file .managed:
45+ - name: {{ postfix.config_path }}/ virtual_mailbox_domains.cf
4246 - source: salt:// postfix/ files/ virtual_mailbox_domains.cf
4347 - user: root
4448 - group: postfix
4549 - mode: ' 0640'
4650 - require:
47- - pkg: postfix
51+ - pkg: postfix- init - pkg - installed - postfix
4852 - watch_in:
49- - service: postfix
53+ - service: postfix- init - service - running - postfix
5054 - template: jinja
5155
52- {{ postfix.config_path }} / virtual_mailbox_maps .cf:
56+ postfix- config - file - managed - virtual - mailbox - maps .cf:
5357 file .managed:
58+ - name: {{ postfix.config_path }}/ virtual_mailbox_maps.cf
5459 - source: salt:// postfix/ files/ virtual_mailbox_maps.cf
5560 - user: root
5661 - group: postfix
5762 - mode: ' 0640'
5863 - require:
59- - pkg: postfix
64+ - pkg: postfix- init - pkg - installed - postfix
6065 - watch_in:
61- - service: postfix
66+ - service: postfix- init - service - running - postfix
6267 - template: jinja
6368{% endif % }
6469
6570{% if salt[' pillar.get' ](' postfix:manage_master_config' , True ) % }
6671{% import_yaml " postfix/services.yaml" as postfix_master_services % }
67- {{ postfix.config_path }} / master.cf:
72+ postfix- config - file - managed - master.cf:
6873 file .managed:
74+ - name: {{ postfix.config_path }}/ master.cf
6975 - source: salt:// postfix/ files/ master.cf
7076 - user: root
7177 - group: {{ postfix.root_grp }}
7278 - mode: ' 0644'
7379 - require:
74- - pkg: postfix
80+ - pkg: postfix- init - pkg - installed - postfix
7581 - watch_in:
76- - service: postfix
82+ - service: postfix- init - service - running - postfix
7783 - template: jinja
7884 - context:
7985 postfix: {{ postfix| tojson }}
@@ -82,23 +88,22 @@ include:
8288
8389{%- for domain in salt[' pillar.get' ](' postfix:certificates' , {}).keys() % }
8490
85- postfix_{{ domain }}_ssl_certificate:
86-
91+ postfix- config- file - managed- {{ domain }}- ssl- certificate:
8792 file .managed:
8893 - name: {{ postfix.config_path }}/ ssl/ {{ domain }}.crt
8994 - makedirs: True
9095 - contents_pillar: postfix:certificates:{{ domain }}:public_cert
9196 - watch_in:
92- - service: postfix
97+ - service: postfix- init - service - running - postfix
9398
94- postfix_ {{ domain }}_ssl_key :
99+ postfix - config - file - managed - {{ domain }}- ssl - key :
95100 file .managed:
96101 - name: {{ postfix.config_path }}/ ssl/ {{ domain }}.key
97102 - mode: ' 0600'
98103 - makedirs: True
99104 - contents_pillar: postfix:certificates:{{ domain }}:private_key
100105 - watch_in:
101- - service: postfix
106+ - service: postfix- init - service - running - postfix
102107
103108{% endfor % }
104109
@@ -120,7 +125,7 @@ postfix_{{ domain }}_ssl_key:
120125 {%- if file_type in (" btree" , " cdb" , " cidr" , " dbm" , " hash" , " pcre" , " regexp" , " sdbm" ) % }
121126 {%- set need_postmap = True % }
122127 {%- endif % }
123- postfix_ {{ mapping }}:
128+ postfix - config - file - managed - {{ mapping }}:
124129 file .managed:
125130 - name: {{ file_path }}
126131 - source: salt:// postfix/ files/ mapping.j2
@@ -135,15 +140,16 @@ postfix_{{ mapping }}:
135140 - context:
136141 data: {{ data| json() }}
137142 - 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
140145 {%- if need_postmap % }
146+ postfix- config- cmd- wait- {{ mapping }}:
141147 cmd.wait:
142148 - name: {{ postfix.xbin_prefix }}/ sbin/ postmap {{ file_path }}
143149 - cwd: /
144150 - watch:
145- - file : {{ file_path }}
151+ - file : postfix - config - file - managed - {{ mapping }}
146152 - watch_in:
147- - service: postfix
153+ - service: postfix- init - service - running - postfix
148154 {%- endif % }
149155{% endfor % }
0 commit comments