Permalink
Browse files

Opting to use the chef nodename as the systems hostname, rather than …

…using an additional attribute
  • Loading branch information...
1 parent 23d3ebe commit fa2647140b0a2878e61f665219a1d4a555e991ae Ben Rockwood committed Sep 20, 2012
Showing with 4 additions and 5 deletions.
  1. +4 −5 cookbooks/smartos/recipes/default.rb
@@ -39,11 +39,10 @@
## Set the Hostname
##
-if node.attribute?("hostname")
- execute "Set hostname to #{node[:hostname]}" do
- command "/usr/bin/hostname #{node[:hostname]} && /usr/bin/hostname > /etc/nodename"
- not_if "grep #{node[:hostname]} /etc/nodename"
- end
+nodename = Chef::Config[:node_name]
+execute "Set hostname to #{nodename}" do
+ command "/usr/bin/hostname #{nodename} && /usr/bin/hostname > /etc/nodename"
+ not_if "grep #{nodename} /etc/nodename"
end

0 comments on commit fa26471

Please sign in to comment.