[design-proposal] Add ability to set attributes based on channel or policy_group · Issue #154 · chef/effortless · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add ability to set attributes based on channel or policy_group
This is to formalize the design proposal discussed in #101. For effortless, it would be great to have the ability to specify different attributes based on channel or policy_group
Motivation
As a Habitat node running Chef Infra effortless,
I want to use different attribute values when in a different channel or policy_group,
so that I can write configs with different, dynamic values.
Specification
Currently, one way of writing different config values is by setting the values based on policy_group. These can be set in the Policyfile.rb and then hoisted to the top level. It would be great to be able to do this in effortless config to make it easier to transition. One option could be to utilize the channel that Habitat is subscribed to and somehow switch on that. Refer to #101 for further discussion on this.
Downstream Impact
Should only impact effortless config
The text was updated successfully, but these errors were encountered:
I was thinking about this a bit and if there was a way to read the Habitat channel that the node is subscribed to from the Chef recipe, then this would probably work pretty easily. I could see having Habitat set an env var, maybe HAB_CHANNEL, and then using that in the Policyfile and recipe like:
# This assumes the Habitat channels "qa" and "prod"# Policyfile.rbdefault['qa']['myattribute']='<qa_value>'default['prod']['myattribute']='<prod_value>'# default.rbmyattribute_value=node["#{ENV['HAB_CHANNEL']}"]['myattribute']
Add ability to set attributes based on channel or policy_group
This is to formalize the design proposal discussed in #101. For effortless, it would be great to have the ability to specify different attributes based on channel or policy_group
Motivation
Specification
Currently, one way of writing different config values is by setting the values based on policy_group. These can be set in the Policyfile.rb and then hoisted to the top level. It would be great to be able to do this in effortless config to make it easier to transition. One option could be to utilize the channel that Habitat is subscribed to and somehow switch on that. Refer to #101 for further discussion on this.
Downstream Impact
Should only impact effortless config
The text was updated successfully, but these errors were encountered: