Created
October 5, 2012 22:15
-
-
Save tlowrimore/3842767 to your computer and use it in GitHub Desktop.
troublesome Vagrantfile
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 : | |
user = ENV['OPSCODE_USER'] || ENV['USER'] | |
base_box = "precise64" | |
# ------------------------------------------------------------------------------ | |
# Short-hand node defs. | |
# ------------------------------------------------------------------------------ | |
nodes = { | |
:eh_app_node => { | |
:ipaddress => "192.168.50.10", | |
:run_list => [ "recipe[rvm::vagrant]", "role[eh_app_node]" ], | |
:hostname => "eh-app-node" | |
}, | |
:eh_db_node => { | |
:ipaddress => "192.168.50.12", | |
:run_list => [ "recipe[rvm::vagrant]", "role[eh_db_node]" ], | |
:hostname => "eh-db-node" | |
}, | |
:eh_search_node => { | |
:ipaddress => "192.168.50.14", | |
:run_list => [ "recipe[rvm::vagrant]", "role[eh_search_node]" ], | |
:hostname => "eh-search-node" | |
} | |
} | |
Vagrant::Config.run do |config| | |
# All Vagrant configuration is done here. The most common configuration | |
# options are documented and commented below. For a complete reference, | |
# please see the online documentation at vagrantup.com. | |
nodes.each do |name, options| | |
config.vm.define name do |node_config| | |
node_config.vm.box = base_box | |
node_config.vm.host_name = options[:hostname] | |
node_config.vm.boot_mode = :headless | |
# Networking | |
node_config.vm.network :hostonly, options[:ipaddress] | |
# Chef provisioner | |
node_config.vm.provision :chef_client do |chef| | |
# Chef server info | |
chef.chef_server_url = "https://api.opscode.com/organizations/coroutine" | |
chef.validation_key_path = ".chef/coroutine-validator.pem" | |
chef.validation_client_name = "coroutine-validator" | |
# Name of the Node and Client on chef-server | |
chef.node_name = "dev-vagrant-#{name}-#{user}" | |
chef.encrypted_data_bag_secret_key_path = ".chef/encrypted_data_bag_secret" | |
chef.environment = "eh_development" | |
chef.provisioning_path = "/etc/chef" | |
chef.log_level = :debug | |
chef.run_list = options[:run_list] | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment