Ansible playbook

If you want to set up multiple mail servers then automation is your friend. Nowadays Ansible is commonly used for that purpose. If you are dealing with system administration you should have such a tool in your toolbox.

I have created an Ansible playbook on Github that you can download and use. Using it is pretty simple:

apt install ansible git
git clone
cd ispmail-bullseye-ansible/ansible
ansible-playbook ispmail.yml -c local

By default the playbook determines your external IP address and uses the domain to use for setting up your mail server. I just realized that does not handle IPv6 correctly. So I’ll have to switch to a more versatile domain like soon.

3 thoughts on “Ansible playbook”

  1. I get this error:
    TASK [ispmail-packages : install software packages] ****************************************************************************************************************************************************************************************
    fatal: []: FAILED! => {“changed”: false, “msg”: “Failed to lock apt for exclusive operation: Failed to lock directory /var/lib/apt/lists/: E:Could not get lock /var/lib/apt/lists/lock. It is held by process 1986 (python3)”}

    Can I just ignore it?

  2. Eben van Deventer

    There appears to be an issue with calling certbot in the ansible playbook. Having edited ./group_vars/all to point to my fqdn_id, I have run the ansible playbook and it errors when restarting postfix (could not find cert files). running it again, it seems to ignore this and gets to apache2 restart, which again has the same issue. Manually running certbot at this point and running it again allows it to complete, but it won’t access the webadmin?
    Perhaps we need better documentation on ./group_vars/all?

Leave a Reply

Your email address will not be published. Required fields are marked *