Symfony, Ansible and your staging server set up in one hour
Maxime Thoonsen2 min read
[Edit]: I’m writting a book about Ansible, click here if want a free draft.
When you start a new project and you create the Ansible provisioning for it, you will do those tasks:
- Find the right role on Ansible Galaxy and check if there is nothing odd inside.
- Write the role you need to have a final working provisioning
- Write the configuration files (group_vars, hosts, var files)
- Configure your Vagrantfile
- Test and debug everything until it works fine
All of this requires time and Ansible’s knowledge to perform. So I wrote a very opinionated and simple yeoman like tool to automate it. My choices are:
- The tool works only on Mac and Linux
- It is designed to provision only Ubuntu’s servers
- It targets only the last Ubuntu LTS (currently xenial)
With very one command line, you get what you want:
What is there inside ?
- A Vagrantfile to launch and configure your local VM
- An Ansible playbook to provision the local VM and the prod. It includes:
- Nginx
- PHP
- Composer
- A database role (Mysql, Postgresql or Mongodb)
- An Ansible playbook which is easy to evolve to satisfy your project specifications
- The Capifony configuration to deploy the code
The steps are pretty straightforward and explained on the documentation.
If you have any question, feel free to ping me on Twitter and/or create an issue on Github. All feedbacks are very welcome =).
If you want to know more about how to build great Ansible playbook, this article may give you some ideas.