2014-08-19 20:32:47 -04:00
|
|
|
include:
|
|
|
|
- postfix
|
|
|
|
|
|
|
|
/etc/postfix:
|
|
|
|
file.directory:
|
|
|
|
- user: root
|
|
|
|
- group: root
|
|
|
|
- dir_mode: 755
|
|
|
|
- file_mode: 644
|
|
|
|
- makedirs: True
|
|
|
|
|
|
|
|
/etc/postfix/main.cf:
|
|
|
|
file.managed:
|
|
|
|
- source: salt://postfix/files/main.cf
|
|
|
|
- user: root
|
|
|
|
- group: root
|
|
|
|
- mode: 644
|
2014-08-19 21:42:08 -04:00
|
|
|
- require:
|
|
|
|
- pkg: postfix
|
2014-08-19 20:32:47 -04:00
|
|
|
- watch_in:
|
2014-08-19 21:46:15 -04:00
|
|
|
- service: postfix
|
2014-08-19 20:32:47 -04:00
|
|
|
- template: jinja
|
2015-03-26 04:43:44 -04:00
|
|
|
{% if salt['pillar.get']('postfix:manage_master_config', True) %}
|
2015-02-05 03:57:18 -05:00
|
|
|
/etc/postfix/master.cf:
|
|
|
|
file.managed:
|
|
|
|
- source: salt://postfix/files/master.cf
|
|
|
|
- user: root
|
|
|
|
- group: root
|
|
|
|
- mode: 644
|
|
|
|
- require:
|
|
|
|
- pkg: postfix
|
|
|
|
- watch_in:
|
|
|
|
- service: postfix
|
|
|
|
- template: jinja
|
2015-03-25 07:49:57 -04:00
|
|
|
{% endif %}
|
2015-06-20 16:49:09 -04:00
|
|
|
|
|
|
|
{% set ssl_certs = salt['pillar.get']('postfix:ssl_certs', {}) -%}
|
|
|
|
{% for name in ssl_certs %}
|
|
|
|
/etc/ssl/private/postfix-{{ name }}.crt:
|
|
|
|
file.managed:
|
|
|
|
- contents: |
|
|
|
|
{{ ssl_certs[name] | indent(8) }}
|
|
|
|
- user: nobody
|
|
|
|
- group: nobody
|
|
|
|
- mode: 444
|
|
|
|
- backup: minion
|
|
|
|
- watch_in:
|
|
|
|
- service: postfix
|
|
|
|
- require:
|
|
|
|
- pkg: postfix
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
|
|
|
|
{% set ssl_keys = salt['pillar.get']('postfix:ssl_keys', {}) -%}
|
|
|
|
{% for name in ssl_keys %}
|
|
|
|
/etc/ssl/private/postfix-{{ name }}.key:
|
|
|
|
file.managed:
|
|
|
|
- contents: |
|
|
|
|
{{ ssl_keys[name] | indent(8) }}
|
|
|
|
- user: nobody
|
|
|
|
- group: nobody
|
|
|
|
- mode: 400
|
|
|
|
- backup: minion
|
|
|
|
- watch_in:
|
|
|
|
- service: postfix
|
|
|
|
- require:
|
|
|
|
- pkg: postfix
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
|