Created
August 1, 2014 15:13
-
-
Save boris/3ecbb0776d9b11400c45 to your computer and use it in GitHub Desktop.
Vagrantfile that will allow you to have more than one vagrant instance (default). To each instance, you can use all the options available (network, provision, etc, etc)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.define "instance0" do |d| | |
d.vm.box = "ubuntu/trusty64" | |
d.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'" | |
d.vm.hostname = "NAME" | |
d.vm.synced_folder ".", "/vagrant" | |
d.vm.network "forwarded_port", guest: 3000, host: 13000 | |
# Chef config only for dev | |
d.vm.provision "chef_client" do |chef| | |
chef.chef_server_url = "https://chef.example.com" | |
chef.node_name = "NODE_NAME" | |
chef.validation_key_path = "/path/to/chef.pem" | |
chef.validation_client_name = "USER" | |
chef.environment = "development" # Or any other env | |
# Run list | |
chef.add_role = "development" | |
end | |
end | |
config.vm.define "instance1" do |m| | |
m.vm.box = "ubuntu/trusty64" | |
m.vm.hostname = "instance1" | |
m.vm.provision "shell", path: "/path/to/script.sh" | |
end | |
config.vm.define "instance2" do |s| | |
s.vm.box = "ubuntu/trusty64" | |
s.vm.hostname = "instance2" | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment