The following blog posts mark my experience using Ansible to provision a LAMP server and run websites off it.
- Install Ansible on Mac OS
- Provision LAMP
- Install sites using Git
- Configure sites
- Setting up a Postfix mail server
- Installing a firewall
I have taken the Ansible route because I find setting up a server tedious and the hope was to achieve the following:
- Make it easier
- Enable me to alter configurations and reinstall components
- Provide clear documentation of what I have installed
ansible-playbook -i ansible_lamp/hosts ansible-ispmail-jessie/ispmail.yml --tags "postfix,dovecot" -vvvv;
which runs only the postfix and dovecot tasks. I ran this a number of times while troubleshooting mail problems (the -vvvv gives me verbose output). The mailserver has always been a tricky task and it has certainly helped to have a full record of all the steps needed to set it up. If Ansible installs the mail server without a problem next time I use it that would be great but even if it doesn't I have a full record of what I needed to do to get it going this time.
It has also occurred to me that it might be helpful to occasionally reset the mysql password. As explained in another post, I now keep my password in php.ini, and use get_config_var() to obtain it from my php scripts, so now I can change it easily and flawlessly simply by running a tag:
ansible-playbook -i ansible_lamp/hosts ansible_lamp/site.yml --tags "mysql" -vvvv;
In conclusion, at this early stage of Ansible use, I would say it is a great application to use and would recommend it to others.