Skip to content

Instantly share code, notes, and snippets.

@tinnet
Last active August 29, 2015 14:14
Show Gist options
  • Save tinnet/5cd7d5512fd15933e6b6 to your computer and use it in GitHub Desktop.
Save tinnet/5cd7d5512fd15933e6b6 to your computer and use it in GitHub Desktop.
VAGRANTFILE_API_VERSION = "2"
def make_group_hash(hostname, groups)
Hash[groups.collect { |group| [group, hostname] }]
end
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "debian/wheezy64"
config.vm.box_url = "https://github.com/jose-lpa/packer-debian_7.6.0/releases/download/1.0/packer_virtualbox-iso_virtualbox.box"
config.vm.provision "ansible" do |ansible|
ansible.playbook = "site.yml"
# ansible.verbose = "vvv"
# set the roles vagrant should have here (eg. dbservers, webservers)
# i recommend always including "vagrant", so you can do `when` checks
# in your deployment: `when: "'vagrant' (not) in group_names"`
ansible.groups = make_group_hash("default", ["vagrant", "dbservers", "rabbitmq"])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment