Set up a postfix server in Debian-like systems.
None
postfix_install
[default:[postfix, mailutils, libsasl2-2, sasl2-bin, libsasl2-modules
]]: Packages to installpostfix_hostname
[default:{{ ansible_fqdn }}
]: Host name, used formyhostname
and inmydestination
postfix_mailname
[default:{{ ansible_fqdn }}
]: Mail name (in/etc/mailname
), used formyorigin
postfix_aliases
[default:[]
]: Aliases to ensure present in/etc/aliases
postfix_relayhost
[default:no
(i.e., no relay host)]: Hostname to relay all email topostfix_relayport
[default: 587]: Relay port (on postfix_relayhost, if set)postfix_sasl_user
[default:postmaster@{{ ansible_domain }}
]: SASL relay usernamepostfix_sasl_password
[default:password
]: SASL relay password
debconf
debconf-utils
A simple example that doesn't use SASL relaying:
---
- hosts: all
roles:
- postfix
vars:
postfix_aliases:
- { user: root, alias: you@yourdomain.org }
Provide the relay host name if you want to enable relaying:
---
- hosts: all
roles:
- postfix
vars:
postfix_aliases:
- { user: root, alias: you@yourdomain.org }
postfix_relayhost: mail.yourdomain.org
You'll probably want to provide the password on the command line when you run the playbook:
--extra-vars postfix_sasl_password=your_relay_pw
MIT
Mischa ter Smitten
Are welcome!