This Vagrant plugin allows you to automatically configure all your Chef client provisioner blocks from your host's knife.rb. Just install the plugin and use the chef-client provisioners in Vagrant. That's it.
vagrant plugin install vagrant-chefconfig
In your Vagrantfile use the plugin like so:
Vagrant.configure('2') do |config|
config.vm.box = "precise64"
config.vm.provision :chef_client do |chef|
chef.node_name = 'vagrant-mydummytest'
chef.run_list = [ 'recipe[dummy::fail]' ]
end
end
The plugin will automatically configure the following Vagrant chef-client provisioner attributes from your knife.rb.
chef_server_url
- samelog_level
- samevalidation_key_path
- maps tovalidation_key
validation_client_name
- sameenvironment
- maps tovagrant_environment
, this is a non-standard knife config key.encrypted_data_bag_secret_key_path
- maps toencrypted_data_bag_secret
Values specified directly in the Vagrantfile override any configured values found in your knife configuration file.
By default the plugin will be enabled and the path to the knife.rb uses the standard Knife configuration loading mechanism. You can override this behavior using the following optional plugin configuration options:
- chefconfig.enabled = false
- chefconfig.knife_config_path = '/my/nonstandard/path/knife.rb'
Initial release for Vagrant 1.5
- Shawn Neal (sneal@sneal.net)
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request