-
-
Save amccloud/2131919 to your computer and use it in GitHub Desktop.
Read in the knife.rb configuration to pass into the Vagrant chef-client provisioner
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
require 'chef' | |
require 'chef/config' | |
require 'chef/knife' | |
current_dir = File.dirname(__FILE__) | |
Chef::Config.from_file(File.join(current_dir, '.chef', 'knife.rb')) | |
Vagrant::Config.run do |config| | |
config.vm.provision :chef_client do |chef| | |
chef.chef_server_url = Chef::Config[:chef_server_url] | |
chef.validation_key_path = "#{current_dir}/.chef/#{Chef::Config[:validation_client_name]}.pem" | |
chef.validation_client_name = Chef::Config[:validation_client_name] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment