Skip to content

Instantly share code, notes, and snippets.

@ivey
Created February 23, 2012 17:01
Show Gist options
  • Save ivey/1893755 to your computer and use it in GitHub Desktop.
Save ivey/1893755 to your computer and use it in GitHub Desktop.
namenode = search(:node, "chef_environment:#{node.chef_environment} AND role:hadoop_namenode_server").first
vars = { :options => node[:hadoop][:core_site] }
vars[:namenode_ip] = namenode[:ipaddress] if namenode
template "/etc/hadoop-#{node[:hadoop][:version]}/conf.chef/core-site.xml" do
mode 0750
owner "hdfs"
group "hdfs"
action :create
variables vars
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment