Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Unknown
-
Resolution: Not A Bug
-
Affects Version/s: 10.14.0
-
Fix Version/s: None
-
Component/s: Chef Server
-
Labels:
-
Environment:
Ubuntu 10.04 LTS amd64
root@server:~# chef-solo -v
Chef: 10.14.0.rc.1
Description
Hi,
I'm using the official ohai-cookbook to distribute custom ohai plugins.
Listed below are test snippets to reproduce the problem :
node.json:
"run_list": [ "recipe[ohai]", "recipe[bjtest]" ]
/bjdev/cookbooks/ohai/files/default/plugins/orly.rb:
provides "orly" orly "teststring"
/bjdev/cookbooks/bjtest/recipes/default.rb:
Chef::Log.info("orly value is: #{node['orly']}") template "/tmp/test.conf" do source "test.conf.erb" owner "root" group "root" mode 0644 end
/bjdev/cookbooks/bjtest/templates/default/test.conf.erb:
Entry <%= node['orly'] %>
The Problem is when I run this without whyrun the template is rendered properly.
/tmp/test.conf:
Entry teststring
But with whyrun, whyrun doesn't recognize the custom ohai attribute and therefore incorrectly displayed that the file will be changed (with empty value).
root@chefomnibus01:~# chef-solo -w -c /bjdev/chef-solo/solo.rb -j /bjdev/chef-solo/node.json-bjtest -Fdoc Starting Chef Client, version 10.14.0.rc.1 [2012-08-30T11:09:50+02:00] INFO: *** Chef 10.14.0.rc.1 *** [2012-08-30T11:09:50+02:00] INFO: Setting the run_list to ["recipe[ohai]", "recipe[bjtest]"] from JSON [2012-08-30T11:09:50+02:00] INFO: Run List is [recipe[ohai], recipe[bjtest]] [2012-08-30T11:09:50+02:00] INFO: Run List expands to [ohai, bjtest] [2012-08-30T11:09:50+02:00] INFO: Starting Chef Run for chefomnibus01 [2012-08-30T11:09:50+02:00] INFO: Running start handlers [2012-08-30T11:09:50+02:00] INFO: Start handlers complete. Compiling Cookbooks... [2012-08-30T11:09:50+02:00] INFO: ohai plugins will be at: /bjdev/ohai-plugins Recipe: ohai::default * remote_directory[/bjdev/ohai-plugins] action create[2012-08-30T11:09:50+02:00] INFO: Processing remote_directory[/bjdev/ohai-plugins] action create (ohai::default line 25) Recipe: <Dynamically Defined Resource> * cookbook_file[/bjdev/ohai-plugins/sysroot_on_nfs.rb] action create[2012-08-30T11:09:50+02:00] INFO: Processing cookbook_file[/bjdev/ohai-plugins/sysroot_on_nfs.rb] action create (dynamically defined) (up to date) * cookbook_file[/bjdev/ohai-plugins/orly.rb] action create[2012-08-30T11:09:50+02:00] INFO: Processing cookbook_file[/bjdev/ohai-plugins/orly.rb] action create (dynamically defined) (up to date) * cookbook_file[/bjdev/ohai-plugins/fqdncustom.rb] action create[2012-08-30T11:09:50+02:00] INFO: Processing cookbook_file[/bjdev/ohai-plugins/fqdncustom.rb] action create (dynamically defined) (up to date) * cookbook_file[/bjdev/ohai-plugins/README] action create[2012-08-30T11:09:50+02:00] INFO: Processing cookbook_file[/bjdev/ohai-plugins/README] action create (dynamically defined) (up to date) (up to date) Recipe: ohai::default * ohai[custom_plugins] action reload[2012-08-30T11:09:50+02:00] INFO: Processing ohai[custom_plugins] action reload (ohai::default line 41) - Would re-run ohai and merge results into node attributes [2012-08-30T11:09:50+02:00] INFO: orly value is: Converging 3 resources * remote_directory[/bjdev/ohai-plugins] action nothing[2012-08-30T11:09:50+02:00] INFO: Processing remote_directory[/bjdev/ohai-plugins] action nothing (ohai::default line 25) (up to date) * ohai[custom_plugins] action nothing[2012-08-30T11:09:50+02:00] INFO: Processing ohai[custom_plugins] action nothing (ohai::default line 41) (up to date) Recipe: bjtest::default * template[/tmp/test.conf] action create[2012-08-30T11:09:50+02:00] INFO: Processing template[/tmp/test.conf] action create (bjtest::default line 7) - Would update file[/tmp/test.conf] from d977ff to d9195b --- /tmp/test.conf 2012-08-30 10:48:10.000000000 +0200 +++ /tmp/chef-rendered-template20120830-12576-qsvhbg 2012-08-30 11:09:50.000000000 +0200 @@ -1,2 +1,2 @@ -Entry teststring +Entry [2012-08-30T11:09:50+02:00] INFO: Chef Run complete in 0.102966778 seconds [2012-08-30T11:09:50+02:00] INFO: Running report handlers [2012-08-30T11:09:50+02:00] INFO: Report handlers complete Chef Client finished, 2 resources updated
Activity
- All
- Comments
- History
- Activity
- Transitions Summary
Daniel DeLeo
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Status | Open [ 1 ] | Closed [ 6 ] |
| Resolution | Not A Bug [ 4 ] |
Bryan McLellan [Opscode]
made changes -
| Workflow | jira [ 16585 ] | New OSS [ 20579 ] |
Bryan McLellan [Opscode]
made changes -
| Workflow | New OSS [ 20579 ] | OSS: Product Management [ 28503 ] |