Skip to content

Instantly share code, notes, and snippets.

@jcalonso
Last active December 27, 2015 06:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcalonso/7282502 to your computer and use it in GitHub Desktop.
Save jcalonso/7282502 to your computer and use it in GitHub Desktop.
Example of a Vagrant file
Vagrant.configure("2") do |config|
config.vm.box = "Ubuntu-12.04-x86_64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.network :private_network, ip: "192.168.111.16"
config.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--memory", 256]
v.customize ["modifyvm", :id, "--name", "My [project name] Development machine"]
end
config.vm.synced_folder "./", "/var/www"
config.vm.provision :shell, :inline =>
"if [[ ! -f /apt-get-run ]]; then sudo apt-get update && sudo touch /apt-get-run; fi"
config.vm.provision :shell, :inline => 'echo -e "mysql_root_password=somePassword controluser_password=somePassword" > /etc/phpmyadmin.facts;'
config.vm.provision :ansible do |ansible|
ansible.verbose = true
ansible.inventory_path = "path/to/ansible/hosts"
ansible.playbook = "path/to/ansible/site.yml"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment