Browse Source

make transport maps configurable

master
parent
commit
1f2839fae5
4 changed files with 17 additions and 1 deletions
  1. +3
    -0
      handlers/main.yml
  2. +6
    -0
      tasks/main.yml
  3. +1
    -1
      templates/main.cf.j2
  4. +7
    -0
      templates/transport_maps.j2

+ 3
- 0
handlers/main.yml View File

@@ -1,5 +1,8 @@
--- ---


- name: postmap transport_maps
command: postmap /etc/postfix/transport_maps

- name: postmap virtual_alias_domains - name: postmap virtual_alias_domains
command: postmap /etc/postfix/virtual_alias_domains command: postmap /etc/postfix/virtual_alias_domains




+ 6
- 0
tasks/main.yml View File

@@ -23,6 +23,12 @@
dest: /etc/postfix/main.cf dest: /etc/postfix/main.cf
notify: reload postfix notify: reload postfix


- name: postfix transport_maps
template:
src: transport_maps.j2
dest: /etc/postfix/transport_maps
notify: postmap transport_maps

- name: postfix virtual_alias_domains - name: postfix virtual_alias_domains
template: template:
src: virtual_alias_domains.j2 src: virtual_alias_domains.j2


+ 1
- 1
templates/main.cf.j2 View File

@@ -44,7 +44,7 @@ smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache


### transport configuration ### transport configuration


#transport_maps = hash:/etc/postfix/transport
transport_maps = hash:/etc/postfix/transport_maps




### rules and restricitons ### rules and restricitons


+ 7
- 0
templates/transport_maps.j2 View File

@@ -0,0 +1,7 @@
{{ansible_managed|comment}}

{% if postfix_transport_maps is defined %}
{% for m in postfix_transport_maps %}
{{m.domain}} {{m.transport}}
{% endfor %}
{% endif %}

Loading…
Cancel
Save