freebsd_ssmtp
freebsd_ssmtp
Ansible role. FreeBSD. Install and configure SSMTP.
Feel free to share your feedback and report issues.
Requirements
Packages
- FreeBSD package or port mail/ssmtp
Collections
- community.general
Variables
Review the defaults and examples in vars.
Workflow
- Change shell on the remote host to /bin/sh if necessary
shell> ansible mailserver -e 'ansible_shell_type=csh ansible_shell_executable=/bin/csh' -a 'sudo pw usermod freebsd -s /bin/sh'
- Install the role and collections
shell> ansible-galaxy role install vbotka.freebsd_ssmtp
Install the collection if necessary
shell> ansible-galaxy collection install community.general
Fit variables to your needs.
Create playbook and inventory
shell> cat freebsd_ssmtp.yml
- hosts: mailserver
roles:
- vbotka.freebsd_ssmtp
shell> cat hosts
[mailserver]
<mailserver-ip-or-fqdn>
[mailserver:vars]
ansible_connection=ssh
ansible_user=freebsd
ansible_become=true
ansible_become_method=sudo
ansible_python_interpreter=/usr/local/bin/python3.9
ansible_perl_interpreter=/usr/local/bin/perl
- Install and configure the mailserver
Install packages
shell> ansible-playbook freebsd-ssmtp.yml -t fm_ssmtp_packages -e fm_ssmtp_install=true
Dry-run the playbook
shell> ansible-playbook freebsd_ssmtp.yml -CD
Run the playbook
shell> ansible-playbook freebsd_ssmtp.yml
- Test it
shell> echo -n 'Subject: test\n\nTesting ssmtp' | sendmail -v [email protected]
Ansible lint
Use the configuration file .ansible-lint.local when running ansible-lint. Some rules might be disabled and some warnings might be ignored. See the notes in the configuration file.
shell> ansible-lint -c .ansible-lint.local
References
- FreeBSD handbook: Setting Up to Send Only
- FreeBSD handbook: Changing the Mail Transfer Agent
- ArchLinux SSMTP
License
Author Information
Install
ansible-galaxy install vbotka/ansible-freebsd-ssmtp
License
bsd-2-clause
Downloads
30
Owner