A generic vagrant template using ansible

Most of the PHP projects I work on have a very similar structure. That’s why I created this template so I can reuse it across most projects.

The initial Ansible package has originated from Phansible.com which is an awesome tool for easy generating vagrant provisioning using ansible.

In order for this to be a good learning exercise, I created a github repository for the generic vagrant template using ansible where I added branches for each configuration step with clear commits along the way.

As an overview, these are the steps I’ve taken.

  • (1) Generate the initial template from Phansible.com
  • (2) Added Ansible tasks to import files in order to create the database schema and also to populate the database.
  • (3) Created composer.json and added a task to run composer.
  • (4) Created a basic hello world application with a namespace that uses composer’s autoloading.

If you’re just interested for the final implementation, go straight to branch step4