Ansible role. FreeBSD. Install and configure Postfix and Dovecot2.
No requiremenst.
TBD. Review the defaults and examples in vars.
- Change shell to /bin/sh.
# ansible mailserver -e 'ansible_shell_type=csh ansible_shell_executable=/bin/csh' -a 'sudo pw usermod freebsd -s /bin/sh'
- Install role.
# ansible-galaxy install vbotka.freebsd_mailserver
- Fit variables.
# editor vbotka.freebsd_mailserver/vars/main.yml
- Create playbook and inventory.
# cat freebsd-mailserver.yml
- hosts: mailserver
roles:
- vbotka.freebsd-mailserver
# cat hosts
[mailserver]
<mailserver-ip-or-fqdn>
[mailserver:vars]
ansible_connection=ssh
ansible_user=freebsd
ansible_become=yes
ansible_become_method=sudo
ansible_python_interpreter=/usr/local/bin/python3.6
ansible_perl_interpreter=/usr/local/bin/perl
- Install and configure the mailserver.
# ansible-playbook freebsd-mailserver.yml
- Consider to test the mailserver with http://mxtoolbox.com/
Create default configuration files of Dovecot to avoid error missing files
# ansible-playbook freebsd-mailserver.yml -t dovecot_example_conf
Then run the check-mode
# ansible-playbook freebsd-mailserver.yml --check