Override Attributes With The Wrapper Cookbook
I just started using Chef and want to install Hadoop on my node. So far I have this very simple recipe that doesn't work.
my-hadoop/attributes/default.rb:
default['hadoop']['core_site']['fs.defaultFS'] = "Test"
my-hadoop/recipes/default.rb:
include_recipe "hadoop"
hadoop_cookbook/attributes/default.rb:
default['hadoop']['core_site']['fs.defaultFS'] = "hdfs://#{node['fqdn']}"
This was my understanding of cookbook wrappers after reading some blog posts. It installs Hadoop, but the default is used every time. Changing the default for any other priority such as "override" does not resolve the issue.
EDIT: The node list is just 'recipe [slave]':
slave/recipes/default:
include_recipe "my-hadoop"
source to share
Your cookbook slave
will depend on my-hadoop
. Then it my-hadoop
will depend onhadoop_cookbook
slave/metadata.rb
:
depends "my-hadoop", "~> 1.5"
File
my-hadoop/metadata.rb
:
depends "hadoop_cookbook", "~> 1.3"
If you've set the default attribute in the cookbook slave
, I believe it just worked.
source to share