Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 0.10.4, 0.10.8
-
Fix Version/s: None
-
Component/s: Chef Shell
-
Labels:None
Description
As a chef user, I want to use shef to debug a failing chef-client run. By default, shef does not process the recipes in the run list and the resource_collection is empty when starting shef in client mode:
% sudo shef -z loading configuration: /etc/chef/client.rb Session type: client Loading......[Mon, 19 Sep 2011 10:21:27 -0600] INFO: Run List is [role[ubuntu]] [Mon, 19 Sep 2011 10:21:27 -0600] INFO: Run List expands to [apt, housepub, ohai, chef_handler, profiled, chef-client::delete_validation, motd-tail, zsh, git, users, vim, emacs, sudo, ntp, resolver, lvm, build-essential, rsyslog::client, logwatch, logrotate, tmux, man, openssh, rsync, postfix, munin::client, gnu_parallel] ..........[Mon, 19 Sep 2011 10:21:32 -0600] INFO: Loading cookbooks [apache2, apt, build-essential, chef-client, chef_handler, cron, emacs, git, gnu_parallel, housepub, logrotate, logwatch, lvm, man, motd-tail, munin, ntp, ohai, openssh, perl, postfix, profiled, resolver, rsync, rsyslog, runit, sudo, tmux, users, vim, zsh] .done. This is shef, the Chef shell. Chef Version: 0.10.4 http://www.opscode.com/chef http://wiki.opscode.com/display/chef/Home run `help' for help, `exit' or ^D to quit. Ohai2u jtimberman@virt1test! chef > recipe chef:recipe > resources [] => nil chef:recipe > run_context.resource_collection => #<Chef::ResourceCollection:0x7f4309e17370 @insert_after_idx=nil, @resources_by_name={}, @resources=[]>
In order to facilitate debugging, shef should provide an easy way to load the recipes from the run_list. You can currently accomplish this by doing the following:
node.run_list.expand(node.chef_environment).recipes.each do |r|
include_recipe r
end
Encapsulating this or something similar into a helper function would make shef a more useful tool for debugging actual chef-client runs. For an example of how this can be helpful see http://stevendanna.github.com/blog/2012/01/28/shef-debugging-tips-1/
Activity
- All
- Comments
- History
- Activity
- Transitions Summary