Skip to content

Instantly share code, notes, and snippets.

@mikerowehl
Created September 19, 2013 23:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mikerowehl/6631396 to your computer and use it in GitHub Desktop.
Save mikerowehl/6631396 to your computer and use it in GitHub Desktop.
Vagrantfile loading config from knife.rb, great for knife-block testing
require 'chef'
Chef::Config.from_file(File.join(ENV['HOME'], '.chef', 'knife.rb'))
Vagrant.configure("2") do |config|
config.omnibus.chef_version = "11.6.0"
config.vm.box = "centos64"
config.vm.provision :chef_client do |chef|
chef.chef_server_url = Chef::Config[:chef_server_url]
chef.validation_key_path = Chef::Config[:validation_key]
chef.validation_client_name = Chef::Config[:validation_client_name]
chef.node_name = 'testnode'
chef.encrypted_data_bag_secret_key_path = "../../bootstrap/encrypted_data_bag_secret.dev"
chef.log_level = Chef::Config[:log_level]
chef.environment = "dev"
chef.add_role("role_for_test")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment