[chef] Re: Chef-solo, ohai node[:fqdn]


Chronological Thread 
  • From:
  • To: " " < >
  • Subject: [chef] Re: Chef-solo, ohai node[:fqdn]
  • Date: Tue, 18 Mar 2014 13:57:36 +0000

I’ve found a ticket describing this https://tickets.opscode.com/browse/OHAI-389

I’ve found a ticket describing this https://tickets.opscode.com/browse/OHAI-389

Is it possible to remove this constant before the call to ohai:reload

eg

Object.send(:remove_const, attr) 
Ohai “reload” do
action :reload
plugin “hostname"
end


Morning all

I’m altering the system hostname in my base cookbook and using the node[:fqdn] in later cookbooks generating configuration data etc.

The problem I get is node[:fqdn] does’t get updated after the hostname change. Even tho I do reload ohai after changing. ( I’m using chef-solo )
The second converge passes the tests as the hostname is correct when ohai reads.


So my questions are

Does ohai action :reload work with chef-solo?
Would node.set[:fqdn] = “new” work from within the recipe changing the hostname. Is this hackish ?
Are there any alternative methods to get the result I’m looking for?


Appreciate the help
D.












Archive powered by MHonArc 2.6.16.

§