Skip to content
Ansible playbook to setup a Vagrant playground with multiple servers for different testing purposes.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Ansible playbook for Vagrant Playground

This is an Ansible playbook used to setup a Vagrant playground with multiple servers for different testing purposes.
For more information about the Vagrant blueprint see vagrant-playground.


Tested on CentOS 7.

Get started

  1. Clone the project and cd in.
git clone
cd ansible-playbook-vagrant-playground
  1. [Optional] Edit the hosts accordingly, edit the IP addresses to reflect the VMs.

  2. Run the playbook playbook_ansible.yml. It will get all the necessary roles and put them in roles/ansible-role-name.

ansible-playbook -i hosts playbook_ansible.yml
  1. Run the playbook playbook_vagrant to initialize the servers.
ansible-playbook -i hosts playbook_vagrant.yml
  1. Now you can run any specific playbook to provision the corresponding VM/VMs.
    For example run the playbook playbook_hostmaster to setup Aegir Drupal hosting system.
ansible-playbook -i hosts playbook_hostmaster.yml

Running on live VM

If you like to run the playbooks against online testing servers, create a new hosts file and encrypt it with ansible vault.
For example, I use the hosts_test to target online testing VMs. hosts file does not contain sensitive information (hostname, IP, SSH port, user) although it's good to think twice about the data we encrypt and publish online.

ansible-vault decrypt hosts_test
ansible-playbook -i hosts_test playbook_full_stack_aegir.yml --ask-vault-pass

Extra info

'roles/' directory

The roles/ directory will be created after the ansible-playbook -i hosts playbook_ansible.yml and contain all the roles for the playbooks.
All the roles are independent projects and ignored by the main project. Check the .gitignore file for details.

'callback_plugins/' directory

The sub-directories in the callback_plugins/ are independent git projects integrated with the git-subrepo. You can recognize them by the .gitrepo file.
To enable a callback plugin edit the ansible.cfg.

The is a bash script used to check the git status for the roles (as sub-projects), just run:


More thinks to do

  • TODO: Add roles to ansible galaxy or replace them with similar roles
  • TODO: Fix the playbook_galera.yml
  • TODO: Fix the playbook_elastic
  • TODO: Fix the playbook_webserver
  • TODO: Fix the playbook_swagger
  • TODO: Fix the playbook_teamcity
You can’t perform that action at this time.