mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-04-12 00:03:17 +02:00
Update to 2023-11-22 16:00
This commit is contained in:
parent
91c6eec01c
commit
e76462f776
@ -31,4 +31,10 @@
|
|||||||
# List of IP addresses which will have access to port 25
|
# List of IP addresses which will have access to port 25
|
||||||
postfix_src_ip: []
|
postfix_src_ip: []
|
||||||
|
|
||||||
|
# A list of domain to relay, with an optional transport
|
||||||
|
# postfix_relay_domains:
|
||||||
|
# - domain: my.domain.org
|
||||||
|
# transport: smtp:[mx.example.org]:25
|
||||||
|
# - domain: another.domain.fr
|
||||||
|
postfix_relay_domains: []
|
||||||
...
|
...
|
||||||
|
@ -1,5 +1,21 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: restart postfix
|
- name: restart postfix
|
||||||
service: name=postfix state=restarted
|
service: name=postfix state=restarted
|
||||||
|
|
||||||
|
- name: reload postfix
|
||||||
|
service: name=postfix state=reloaded
|
||||||
|
|
||||||
|
- name: rehash relay_auth
|
||||||
|
command: postmap /etc/postfix/relay_auth
|
||||||
|
notify: reload postfix
|
||||||
|
|
||||||
|
- name: rehash relay_domains
|
||||||
|
command: postmap /etc/postfix/relay_domains
|
||||||
|
notify: reload postfix
|
||||||
|
|
||||||
|
- name: rehash transport_maps
|
||||||
|
command: postmap /etc/postfix/transport_maps
|
||||||
|
notify: reload postfix
|
||||||
|
|
||||||
...
|
...
|
||||||
|
@ -26,19 +26,19 @@
|
|||||||
notify: restart postfix
|
notify: restart postfix
|
||||||
tags: postfix
|
tags: postfix
|
||||||
|
|
||||||
- name: Deploy Relay authentication map
|
- name: Deploy relay_auth
|
||||||
template: src=relay_auth.j2 dest=/etc/postfix/relay_auth mode=600 owner=root group=root
|
template: src=relay_auth.j2 dest=/etc/postfix/relay_auth mode=600 owner=root group=root
|
||||||
register: relay_auth_file
|
notify: rehash relay_auth
|
||||||
tags: postfix
|
tags: postfix
|
||||||
|
|
||||||
- name: Check if relay_auth has been hashed
|
- name: Deploy relay_domains
|
||||||
stat: path=/etc/postfix/relay_auth.db
|
template: src=relay_domains.j2 dest=/etc/postfix/relay_domains mode=644 owner=root group=root
|
||||||
register: relay_auth_hashed
|
notify: rehash relay_domains
|
||||||
tags: postfix
|
tags: postfix
|
||||||
|
|
||||||
- name: Rehash postfix relay auth
|
- name: Deploy transport_maps
|
||||||
command: postmap /etc/postfix/relay_auth
|
template: src=transport_maps.j2 dest=/etc/postfix/transport_maps mode=644 owner=root group=root
|
||||||
when: relay_auth_file.changed or not relay_auth_hashed.stat.exists
|
notify: rehash transport_maps
|
||||||
tags: postfix
|
tags: postfix
|
||||||
|
|
||||||
- name: Handle postfix port
|
- name: Handle postfix port
|
||||||
|
@ -50,4 +50,7 @@ owner_request_special = no
|
|||||||
transport_maps = hash:{{ mailman_root_dir | default('/opt/mailman') }}/data/data/postfix_lmtp
|
transport_maps = hash:{{ mailman_root_dir | default('/opt/mailman') }}/data/data/postfix_lmtp
|
||||||
local_recipient_maps = hash:{{ mailman_root_dir | default('/opt/mailman') }}/data/data/postfix_lmtp
|
local_recipient_maps = hash:{{ mailman_root_dir | default('/opt/mailman') }}/data/data/postfix_lmtp
|
||||||
relay_domains = hash:{{ mailman_root_dir | default('/opt/mailman') }}/data/data/postfix_domains
|
relay_domains = hash:{{ mailman_root_dir | default('/opt/mailman') }}/data/data/postfix_domains
|
||||||
|
{% else %}
|
||||||
|
relay_domains = hash:/etc/postfix/relay_domains
|
||||||
|
transport_maps = hash:/etc/postfix/transport_maps
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
3
roles/postfix/templates/relay_domains.j2
Normal file
3
roles/postfix/templates/relay_domains.j2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{% for domain in postfix_relay_domains %}
|
||||||
|
{{ domain.domain }} 1
|
||||||
|
{% endfor %}
|
5
roles/postfix/templates/transport_maps.j2
Normal file
5
roles/postfix/templates/transport_maps.j2
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{% for domain in postfix_relay_domains %}
|
||||||
|
{% if domain.transport is defined %}
|
||||||
|
{{ domain.domain }} {{ domain.transport }}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
Loading…
x
Reference in New Issue
Block a user