Setting up email services via Ansible Automation
We are going to set up postfix
with Ansible Automation using a set of variables and a loop. This will allow us to create the same setup that we got when doing things manually, but done here in an iterative manner using a loop. First, we will set up our playbook directory and then our inventory file. The inventory file can be seen in the following screenshot:
Figure 6.22 – Inventory for email playbook
We are going to start our playbook with the normal starting format, as seen in the following code:
--- - name: Setup null client email server hosts: email_servers become: true become_method: sudo
After we have set up the beginning of the playbook, let’s create the tasks required to get the playbook to successfully configure a null client. We will use a loop and loop over the variables we provide to the playbook. We can see the playbook in the following...