Complete Ansible, Vagrant and AWS infrastructure

IaC example is a simple example of Infrastructure as code (IaC) to automate a development environment based on Vagrant and a staging, production environment on AWS. The installation creates a basic Symfony application along with a PostgreSQL, Solr and Redis services. Ansible helps automate all the infrastructure tasks and the bash scripts act as a wrapper for the Ansible commands.

Vagrant provisioning

  • Install Vagrant and clone this repo.
  • vagrant up to start installation
  • The installation will provision 2 boxes myproject and services, you can retry provisioning using vagrant provision if it failed.
  • After provisioning the vagrant boxes you should access the symfony project on which is a basic symfony example project.
  • All redispostgreSQL and solr services are on the services box.
  • Root is /var/www/application
  • MyProject IP is
  • Services IP is

AWS provisioning (AWS will charge you for launching services)

  • Login vagrant vagrant ssh myproject
  • Change the password and ssh key to yours and remove the prod_files from your repo /var/www/application/prod_files
  • Add the production password and ssh keys to vagrantbash /var/www/application/prod_files/
  • Encrypt your AWS keys as shown on provision/ansible/
  • Go to /var/www/application/provision/ansible
  • run ./ to start building the infrastructure on AWS.
  • Edit the deploy script roles/deploy-application/files/myproject/ to fit your requirements.

Solr Admin



Visit on Github