Skip to content

Instantly share code, notes, and snippets.

@pghalliday
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pghalliday/73e10ff42baaecfc5fb3 to your computer and use it in GitHub Desktop.
Save pghalliday/73e10ff42baaecfc5fb3 to your computer and use it in GitHub Desktop.
Opcode Chef cascade attribute overrides
#
# What user gets created when `cookbook_c` is applied?
#
# cookbook_a/attributes/default.rb
node[cookbook_a][user] = 'a'
# cookbook_a/recipes/default.rb
user node[cookbook_a][user]
# cookbook_b/attributes/default.rb
node[cookbook_b][user] = 'b'
# cookbook_b/recipes/default.rb
node.override[cookbook_a][user] = node[cookbook_b][user]
include_recipe 'cookbook_a'
# cookbook_c/attributes/default.rb
node[cookbook_c][user] = 'c'
# cookbook_c/recipes/default.rb
node.override[cookbook_b][user] = node[cookbook_c][user]
include_recipe 'cookbook_b'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment