Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
infra
ansible-shared
communication
Commits
6bbd1835
Commit
6bbd1835
authored
Jul 21, 2019
by
Hinrikus Wolf
Browse files
add smarthost and transport_map capabilities
parent
0b5a40e5
Changes
5
Show whitespace changes
Inline
Side-by-side
postfix/defaults/main.yml
View file @
6bbd1835
...
...
@@ -33,3 +33,11 @@ postfix_aliases_rt: []
# - queue: IT
# url: https://rt.example.com
# address: it
postfix_relay_host
:
"
"
postfix_transport_maps
:
[]
# - domain: foo.example.com
# server: mail.bar.example.com
# port: 2025
# protocol: smtp
# use_mx: true
postfix/handlers/main.yml
View file @
6bbd1835
...
...
@@ -11,3 +11,6 @@
-
name
:
postmap virtual
command
:
postmap cdb:/etc/postfix/virtual
-
name
:
postmap transport
command
:
postmap cdb:/etc/postfix/transport
postfix/tasks/main.yml
View file @
6bbd1835
...
...
@@ -116,3 +116,14 @@
tags
:
-
postfix
-
mail
-
name
:
ensure transport_maps are configured
template
:
src
:
transport.j2
dest
:
/etc/postfix/transport
notify
:
-
postmap transport
when
:
postfix_transport_maps|bool
tags
:
-
postfix
-
mail
postfix/templates/main.cf.j2
View file @
6bbd1835
...
...
@@ -6,7 +6,10 @@ myhostname = {{ ansible_fqdn }}
myorigin = /etc/mailname
mydestination = $myhostname localhost {{ postfix_domains | join(" ") }}
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
relayhost =
relayhost = {{ postfix_relay_host }}
{% if postfix_transport_maps|bool %}
transport_maps = cdb:/etc/postfix/transport
{% endif %}
{% if postfix_domains|count > 0 %}
{% if postfix_prefer_lmtp %}
mailbox_transport = lmtp:unix:private/dovecot-lmtp
...
...
postfix/templates/transport.j2
0 → 100644
View file @
6bbd1835
{% for transport in postfix_transport_maps %}
{% if transport.use_mx|default(true) %}
{{ transport.domain }} {{ transport.protocol|default("") }}:{{ transport.server }}{{ ":"~transport.port if transport.port|default(false)|bool else "" }}
{% else %}
{{ transport.domain }} {{ transport.protocol|default("") }}:[{{ transport.server }}]{{ ":"~transport.port if transport.port|default(false)|bool else "" }}
{% endif %}
{% endfor %}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment