Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#
# Cookbook Name:: cloud
# Recipe:: hostname
#
template "/etc/hosts" do
source "hostname/hosts.erb"
owner "root"
group "root"
mode 0644
backup false
end
execute "Reset Hostname" do
command "hostname --file /etc/hostname"
action :nothing
end
file "/etc/hostname" do
content node.name
notifies :run, resources(:execute => "Reset Hostname"), :immediately
end
127.0.0.1 localhost.localdomain localhost
<%= node.ipaddress %> <%= node.name %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.