Generate your Ansible provisioning for Symfony2, Laravel and Node.js projects
Create easily your Ansible provisioning for Symfony, Laravel and Node.js projects.
This have been tested with the Ubuntu OS. It should work with many other various Debian distribution. Feel free to share your advice for the other OS.. This is what you will need to install if you haven't done yet:
sudo apt-get install nfs-kernel-server
Installation.
git clone [email protected]:fansible/tywin.git ~/tywin
Generate the default conf
You can generate the default conf by running in the root directory of your project:
python ~/tywin/generate.py
You can now find your provisioning in the devops
directory
Create the VM
You can create the VM with vagrant up
.
Log in your vagrant with vagrant ssh
and put your ssh key in the .ssh/authorized_keys file.
Log out and try to log in again using ssh ubuntu@IP_OF_YOUR_VAGRANT (MAYBE 10.0.0.10 check your Vagrantfile)
If it's OK you can provision the VM
Provision it with ansible-playbook -i devops/provisioning/hosts/vagrant devops/provisioning/playbook.yml
.
If something goes wrong you can go inside your vagrant and try to execute manually in your shell the Ansible task that is failing.
After that, your VM is now ready! You can see your project in your browser at the IP's adress (10.0.0.10 if you haven't changed anything) =)
devops/provisioning/hosts/staging
and add the IP or domain of your server.Change the value of the database configuration in devops/provisioning/group_vars/vagrant
What you can do:
Add your roles in the devops/provisioning/roles
directory.
Modify the playbook to call your roles.
Overide vars (in devops/provisioning/vars
).
If you want to have more information on the use of Ansible/Vagrant for you development environment, I wrote a blog post about it.
If you have any question ask me on Twitter !