freebsd_ssmtp

freebsd_ssmtp

quality Build Status GitHub tag

Ansible role. FreeBSD. Install and configure SSMTP.

Feel free to share your feedback and report issues.

Contributions are welcome.

Requirements

Packages

  • FreeBSD package or port mail/ssmtp

Collections

  • community.general

Variables

Review the defaults and examples in vars.

Workflow

  1. 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'
  1. 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
  1. Fit variables to your needs.

  2. 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
  1. 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
  1. 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

License

license

Author Information

Vladimir Botka

About

FreeBSD. Install and configure SSMTP.

Install
ansible-galaxy install vbotka/ansible-freebsd-ssmtp
GitHub repository
License
bsd-2-clause
Downloads
30