Add configuration for virtual and relay domains and aliases
This commit is contained in:
parent
8d7838ad26
commit
bce2d91ea3
8 changed files with 81 additions and 24 deletions
9
templates/postfix/conf.d/relay_domains.j2
Normal file
9
templates/postfix/conf.d/relay_domains.j2
Normal file
|
@ -0,0 +1,9 @@
|
|||
# {{ ansible_managed }}
|
||||
|
||||
{% if postfix_domains is defined %}
|
||||
{% for domain in postfix_domains %}
|
||||
{% if domain.type == "relay" %}
|
||||
{{ "%-50s %s" | format(domain.name, "#domain") }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
25
templates/postfix/conf.d/virtual_aliases.j2
Normal file
25
templates/postfix/conf.d/virtual_aliases.j2
Normal file
|
@ -0,0 +1,25 @@
|
|||
# {{ ansible_managed }}
|
||||
|
||||
# Example variables list
|
||||
#
|
||||
# postfix_aliases:
|
||||
# - domain: mydomain.org
|
||||
# comment: |
|
||||
# Mydomain.org
|
||||
# List of Aliases
|
||||
# aliases:
|
||||
# - name: foo
|
||||
# dest:
|
||||
# - "alice@yourdomain.org
|
||||
# - "bob@yourdomain.org
|
||||
|
||||
{% if postfix_aliases is defined %}
|
||||
{% for domain in postfix_aliases %}
|
||||
{% if domain.comment is defined %}
|
||||
# {{ domain.comment }}
|
||||
{% endif %}
|
||||
{% for alias in domain.aliases %}
|
||||
{{ "%-50s %s" | format(alias.name, alias.dest | join(',')) }}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
|
@ -1,7 +1,9 @@
|
|||
# {{ ansible_managed }}
|
||||
|
||||
{% if postfix_virtual_domains is defined %}
|
||||
{% for domain in postfix_virtual_domains %}
|
||||
{% if postfix_domains is defined %}
|
||||
{% for domain in postfix_domains %}
|
||||
{% if domain.type == "virtual" %}
|
||||
{{ "%-50s %s" | format(domain.name, "#domain") }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue