Project
Ansible, Vagrant and AWS infrastructure
A complete example of one Ansible code base that builds the same environment twice: on local Vagrant machines for development, and on AWS for production.
Local:
vagrant upprovisions two machines, an application server and a services server with PostgreSQL, Redis and Solr.AWS: one script builds the infrastructure with the same roles: security groups, instances and machine images, plus a teardown role to remove it all again.
Roles: nginx, PHP, Node.js, database server, firewall, SSH configuration, swap, cron and mail, each reusable on its own.
Deployment: roles that build the release artifact and deploy the application, with a deploy script to adapt.
Secrets: cloud keys are kept encrypted with Ansible Vault.