Skip to content

Instantly share code, notes, and snippets.

@andresdouglas
Created January 26, 2012 02:16
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 andresdouglas/1680515 to your computer and use it in GitHub Desktop.
Save andresdouglas/1680515 to your computer and use it in GitHub Desktop.
cat Vagrantfile
user = ENV['OPSCODE_USER'] || ENV['USER']
base_box = ENV['VAGRANT_BOX'] || 'ubuntu-11.10-server-amd64'
Vagrant::Config.run do |config|
config.vm.define :web1dev do |config|
config.vm.box = base_box
config.vm.network('33.33.33.10')
config.vm.forward_port("http", 80, 8080)
config.vm.customize do |vm|
vm.memory_size = 256
end
config.vm.provision :chef_client do |chef|
chef.chef_server_url = "http://chef.hackercache.net:4000"
chef.validation_key_path = ".chef/validation.pem"
chef.environment = "dev"
chef.node_name = "dev-vagrant-web1-#{user}"
# Put the client.rb in /etc/chef so chef-client can be run w/o
# specifying
chef.provisioning_path = "/etc/chef"
chef.log_level = :info
chef.run_list = [
"role[base]",
"recipe[ntp]",
]
end
end
config.vm.define :db1dev do |config|
config.vm.box = base_box
config.vm.network('33.33.33.20')
config.vm.forward_port("postgres", 5432, 54320)
config.vm.customize do |vm|
vm.memory_size = 256
end
config.vm.provision :chef_client do |chef|
chef.chef_server_url = "http://chef.hackercache.net:4000"
chef.validation_key_path = ".chef/validation.pem"
chef.environment = "dev"
chef.node_name = "dev-vagrant-db1-#{user}"
# Put the client.rb in /etc/chef so chef-client can be run w/o
# specifying
chef.provisioning_path = "/etc/chef"
chef.log_level = :debug
# chef.add_recipe "postgresql::server"
chef.run_list = [
"role[base]",
"role[db_master]",
]
end
end
config.vm.define :chef1 do |config|
config.vm.box = "ubuntu-lucid-64"
config.vm.network('33.33.33.50')
config.vm.forward_port("web", 80, 80)
config.vm.forward_port("chef-server", 4000, 4000)
config.vm.forward_port("chef-server-webui", 4040, 4040)
config.vm.forward_port("couchdb", 5984, 5984)
config.vm.forward_port("rabbitmq", 5672, 5672)
config.vm.forward_port("chef-solr", 8983, 8983)
config.vm.customize do |vm|
vm.memory_size = 256
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment