Sent from my BlackBerry 10 smartphone on the Verizon Wireless 4G LTE network.
A lot of people also just sidestep all of this fun by setting the hostname at bootstrap time, before the initial Chef run.
Although the problem comes back in full, if you need to change the hostname later :-)
Mat
On Thursday, October 9, 2014, Lamont Granquist <
">
> wrote:
"setting the automatic_attrs" wasn't really the point of that code
I pasted there. the point is to execute it at compile time rather
than converge time. the code you point to in the system cookbook
is inside of a provider and will also get executed at converge
time. you can call the system_hostname LWRP yourself and force it
to run at compile time by method chaining .run_action(:set) off of
it (and add an `action :nothing` attribute inside the LWRP).
On 10/9/14, 8:13 PM, Greg Barker wrote:
Thanks Lamont. I tried using the
system
cookbook which seems to do as you have suggested (
setting
the automatic_attrs) but it still doesn't work.
The system cookbook is first in my run list and then towards
the end it gets to my recipe which contains:
node.override["chef-server"]["configuration"]["nginx"]["ssl_certificate"]
= "/etc/pki/tls/certs/#{node['fqdn']}.pem"
...but it still thinks node['fqdn'] is localhost, it doesn't
get the updated value.
I guess I will just have to steer clear of relying on
node['fqdn'] unless you have any other ideas, it's a bummer
that so many cookbooks use it though.
Greg
--
Rock Solid Ops: development & operations consulting for Ruby on Rails