Last active
August 20, 2018 18:31
-
-
Save grimm26/109be1672333db991f977ef718831ec8 to your computer and use it in GitHub Desktop.
nested attributes
This file contains 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
default['my-apt']['nodejs_version'] = 6 | |
default['my-apt']['nodejs_server'] = "#{node['my-apt']['server']}/nodejs-#{node['my-apt']['nodejs_version']}" | |
# Then in another cookbook's attributes/fdefault.rb | |
override['my-apt']['nodejs_version'] = 10 if %w[xenial bionic].include?(node['lsb']['codename']) | |
# node['enova-apt']['nodejs_version'] is set to 10 on xenial/bionic nodes like expected, but node['my-apt']['nodejs_server'] keeps the default '6' value. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment