Merge pull request #38 from danoe/relay_domains
manage relay_domains file from pillar
This commit is contained in:
commit
d167e4fb13
3 changed files with 15 additions and 0 deletions
|
@ -11,6 +11,9 @@ postfix:
|
||||||
- someuser_2@example.com
|
- someuser_2@example.com
|
||||||
singlealiasexample: 'someuser_3@example.com'
|
singlealiasexample: 'someuser_3@example.com'
|
||||||
|
|
||||||
|
relay_domains:
|
||||||
|
example.com: 'OK'
|
||||||
|
|
||||||
sasl_passwd:
|
sasl_passwd:
|
||||||
smtp.example.com: 'somepassword'
|
smtp.example.com: 'somepassword'
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,11 @@ run-newaliases:
|
||||||
{{ postmap_file('virtual') }}
|
{{ postmap_file('virtual') }}
|
||||||
{% endif %}
|
{% 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
|
# manage /etc/postfix/sasl_passwd if data found in pillar
|
||||||
{% if 'sasl_passwd' in pillar.get('postfix', '') %}
|
{% if 'sasl_passwd' in pillar.get('postfix', '') %}
|
||||||
{{ postmap_file('sasl_passwd', 600) }}
|
{{ postmap_file('sasl_passwd', 600) }}
|
||||||
|
|
7
postfix/relay_domains
Normal file
7
postfix/relay_domains
Normal 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 %}
|
Loading…
Reference in a new issue