Skip to content

Latest commit

 

History

History
37 lines (31 loc) · 1.3 KB

README.md

File metadata and controls

37 lines (31 loc) · 1.3 KB

Vagrant box bootstrapping

Base role for Dalee/ubuntu Vagrant box.

Role will uninstall some crap (like command-not-found) and install some mandatory software and some useful commands:

  • pavlik-enable Comrade Pavlik helper script
  • docker-cleanup Docker images/containers cleanup script
  • avahi daemon to advertise hostname
  • avahi-cname-aliases script to advertise cname aliases for host via avahi
  • nginx daemon
  • ~/.environment.rc — loader for role-based environment variables (make sure to add this file to .bash_profile)

Mandatory parameters

Vagrantfile and ansible provision script should define two variables:

  • project_root - vagrant path, usually /home/web/project
  • project_name - hostname, will be used for <project_name>.local domain

Vagrantfile example:

config.vm.provision "shell", path: "build/ansible.sh",
    env: {
        "PROJECT_ROOT": "/home/web/project",
        "PROJECT_NAME": "sample-project",
    }

ansible.sh example:

/usr/bin/ansible-playbook \
	-e "project_root"=${PROJECT_ROOT} \
	-e "project_name"=${PROJECT_NAME} \
	-i "${PROJECT_ROOT}/build/inventory.ini" \
	"${PROJECT_ROOT}/build/vagrant.yml"