Merge pull request #38 from danoe/relay_domains

manage relay_domains file from pillar
This commit is contained in:
Forrest 2016-05-19 11:42:37 -07:00
commit d167e4fb13
3 changed files with 15 additions and 0 deletions

View File

@ -11,6 +11,9 @@ postfix:
- someuser_2@example.com
singlealiasexample: 'someuser_3@example.com'
relay_domains:
example.com: 'OK'
sasl_passwd:
smtp.example.com: 'somepassword'

View File

@ -56,6 +56,11 @@ run-newaliases:
{{ postmap_file('virtual') }}
{% endif %}
# manage /etc/postfix/relay_domains if data found in pillar
{% if 'relay_domains' in pillar.get('postfix', '') %}
{{ postmap_file('relay_domains') }}
{% endif %}
# manage /etc/postfix/sasl_passwd if data found in pillar
{% if 'sasl_passwd' in pillar.get('postfix', '') %}
{{ postmap_file('sasl_passwd', 600) }}

7
postfix/relay_domains Normal file
View File

@ -0,0 +1,7 @@
# Managed by config management
{% set canonical = salt['pillar.get']('postfix:relay_domains',{}) -%}
{% if canonical is iterable -%}
{% for key,value in salt['pillar.get']('postfix:relay_domains',{}).iteritems() -%}
{{ key }} {{ value }}
{% endfor %}
{% endif %}