Chef-solo, ohai node

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.

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

On 18 Mar 2014, at 11:13, dcroche@gmail.com wrote:

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.