i'm struggling with the chef recipes for a vagrant box. I'm using chef-solo.
I'm not so comfortable with Ruby (i've never used it before), so the process to write my recipes is very long if i have to do vagrant provision
each time.
Is there a way to debug a specific recipe? Even from the virtual machine shell.
I've seen that chef-shell
exists (http://docs.opscode.com/chef_shell.html), and i can launch it (it works) when i'm inside the virtual machine, but i can't understand how to load my recipes and test them.
The proper way to enable debug output in the current vagrant chef provisioner is with chef.log_level, not with chef-solo manually or with chef.arguments:
Vagrant.configure("2") do |config|
# ...
config.vm.provision :chef_solo do |chef|
chef.log_level = :debug
# ...
end
end
In addition to the above input, which is execllent;-)
Runing chef-solo
in debug mode (enable debug output) will definitely help.
For example
chef-solo -c solo.rb -j node.json -l debug
If you run chef-solo inside Vagrant additional custom arguments (for logging/debugging) can be injected from the Vagrantfile like this:
Vagrant.configure("2") do |config|
# ...
config.vm.provision :chef_solo do |chef|
chef.arguments = '-l debug'
# ...
end
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With