2022-06-12 00:15:27 +02:00
2022-06-12 00:15:27 +02:00
2022-06-11 22:09:29 +00:00
2022-06-12 00:15:27 +02:00

ansible-mail-infra

Set up infrastructure for all things e-mail

Prep

On your Ansible controller make sure the sshpass binary exists if Ansible has to connect to target machines via SSH username-password authentication instead of SSH key authentication. The binary usually comes with a package of the same name.

We're assuming that you're running Ansible as a Python package inside a virtual environment. Install Ansible like so:

pip install ansible

We're also assuming that secrets are stored in a HashiCorp Vault instance to which you have access. These role access Vault via hvac, the HashiCorp Vault API client for Python 3.x, see github.com/hvac/hvac for reference. Install it like so:

pip install hvac

Vars

Run it

On first run execute it like so:

ansible-playbook --tags 'first_run' --inventory hosts.yml playbook.yml

The first_run tag ensures that ansible_password variable gets set which in turn causes Ansible to log in to target machines via SSH username-password authentication.

On subsequent runs like so:

ansible-playbook --inventory hosts.yml playbook.yml
Description
Set up infrastructure for all things e-mail
Readme 674 KiB
Languages
Jinja 100%