Merge pull request #16 from jeroen92/master

Add option to let the module (not) manage the master.cf
This commit is contained in:
Nitin Madhok 2015-03-30 04:01:25 -04:00
commit 037470d46b
3 changed files with 23 additions and 21 deletions

View File

@ -1,23 +1,25 @@
postfix: postfix:
smtpd_banner: $myhostname ESMTP $mail_name manage_master_config: True
biff: 'no' config:
smtpd_banner: $myhostname ESMTP $mail_name
biff: 'no'
append_dot_mydomain: 'no' append_dot_mydomain: 'no'
readme_directory: 'no' readme_directory: 'no'
smtpd_tls_cert_file: /etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_cert_file: /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file: /etc/ssl/private/ssl-cert-snakeoil.key smtpd_tls_key_file: /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls: 'yes' smtpd_use_tls: 'yes'
smtpd_tls_session_cache_database: btree:${data_directory}/smtpd_scache smtpd_tls_session_cache_database: btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database: btree:${data_directory}/smtp_scache smtp_tls_session_cache_database: btree:${data_directory}/smtp_scache
myhostname: localhost myhostname: localhost
alias_maps: hash:/etc/aliases alias_maps: hash:/etc/aliases
alias_database: hash:/etc/aliases alias_database: hash:/etc/aliases
mydestination: localhost, localhost.localdomain mydestination: localhost, localhost.localdomain
relayhost: relayhost:
mynetworks: 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mynetworks: 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit: 0 mailbox_size_limit: 0
recipient_delimiter: + recipient_delimiter: +
inet_interfaces: all inet_interfaces: all

View File

@ -20,7 +20,7 @@ include:
- watch_in: - watch_in:
- service: postfix - service: postfix
- template: jinja - template: jinja
{% if salt['pillar.get']('postfix:manage_master_config', True) %}
/etc/postfix/master.cf: /etc/postfix/master.cf:
file.managed: file.managed:
- source: salt://postfix/files/master.cf - source: salt://postfix/files/master.cf
@ -32,4 +32,4 @@ include:
- watch_in: - watch_in:
- service: postfix - service: postfix
- template: jinja - template: jinja
{% endif %}

View File

@ -1,4 +1,4 @@
{% set config = salt['pillar.get']('postfix', {}) -%} {% set config = salt['pillar.get']('postfix:config', {}) -%}
{% set processed_parameters = ['aliases', 'virtual'] -%} {% set processed_parameters = ['aliases', 'virtual'] -%}
{% macro set_parameter(parameter, default=None) -%} {% macro set_parameter(parameter, default=None) -%}
{% set value = config.get(parameter, default) -%} {% set value = config.get(parameter, default) -%}