Skip to content

Instantly share code, notes, and snippets.

@statik
Created December 3, 2010 17:19
Show Gist options
  • Save statik/727241 to your computer and use it in GitHub Desktop.
Save statik/727241 to your computer and use it in GitHub Desktop.
# Customize the chef node name and use your own Opscode platform organization
# with this Vagrantfile. Mind the validation key path setting and make sure your
# validation key is correct.
#
# If you're using your own Chef Server, substitute the proper URL and validation client
# and key names.
#
# Export the following shell environment variables before running vagrant up:
#
# export ORGNAME=your_platform_organization
# export CHEF_NODE="desired_chef_node_name"
Vagrant::Config.run do |config|
config.vm.box = "lucid64"
config.vm.provisioner = :chef_server
# Set up some organization specific values based on environment variable above.
config.chef.chef_server_url = "https://api.opscode.com/organizations/#{ENV['ORGNAME']}"
config.chef.validation_key_path = "#{ENV['HOME']}/.chef/#{ENV['ORGNAME']}-validator.pem"
config.chef.validation_client_name = "#{ENV['ORGNAME']}-validator"
# Change the node/client name for the Chef Server
config.chef.node_name = ENV['CHEF_NODE']
# Put the client.rb in /etc/chef so chef-client can be run w/o specifying
config.chef.provisioning_path = "/etc/chef"
# adjust the run list to suit your testing needs. It is a Ruby array, and cannot be empty
config.chef.run_list = [
"role[base]"
]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment