Last active
December 10, 2015 02:48
-
-
Save lehrblogger/4370273 to your computer and use it in GitHub Desktop.
Trying to figure out proper environment and cookbook attribute syntax for Chef
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In my environment json file: | |
"default_attributes": { | |
"source_dir": "/vagrant/source_dir" | |
}, | |
# When I look in the list of attributes at https://manage.opscode.com/nodes/[node_name], | |
# I see the 'source_dir' attribute, so far so good. | |
# Then, in my cookbook's default.rb attributes file: | |
default['mycookbook']['dir'] = "#{default[:source_dir].to_s}/mycookbook" | |
# And then run a provision, it seems happy, but then looking back at | |
# https://manage.opscode.com/nodes/[node_name], I see the mycookbook attribute as a hash, | |
# but the 'dir' attribute has a value of "#<Chef::Node::Attribute:0x0000000295d088>/mycookbook", | |
# rather than "/vagrant/source_dir/mycookbook". |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment