Skip to content

Instantly share code, notes, and snippets.

@srinivasmohan
srinivasmohan / whatsmyname.rb
Last active October 3, 2015 18:27
Chef recipe (snippets) to setup FQDN, hostname, IP etc properly
#Knife invocations supply FQDN as the node name at creation time and this becomes hostname( option -N)
execute "Configure Hostname" do
command "hostname --file /etc/hostname"
action :nothing
end
#Ensure the hostname of the system is set to knife provided node name
file "/etc/hostname" do
content node.name