- From: Jenn Fountain <
>
- To:
- Subject: [chef] dynamically setting attributes
- Date: Mon, 10 Feb 2014 10:00:18 -0500
Ohai!
I am trying to create a generic cookbook that will deploy different
applications. Everything about these app installations are the same save the
installation URL. What I want to do may not even be possible or I should do
it another way. I am hoping someone here could give me some suggestions.
Each of these applications has a testing, staging and production environment.
As a result, three different installation URLs.
Each application name is set using this attribute in the role:
default[:application][:name] = nil
And I want to set the install URL in the environment and reference it like
this or however I need to reference it (this is where I am not sure :D):
default#{node[:application][:name]}[:install][:url] = nil
For example:
default[:application][:name] = ‘myapp’ in the “myapp” role
default[:myapp][:install][:url] =
http://someurl/myapp.git <<— where :myapp
is pulled from the above attribute.
I thought about databags, creating different Roles - "Myapp - Testing role”
but I really was hoping to pull it from the name.
Any ideas would be appreciated. Can I even do this? Should I? :D
Thanks!!!
-J
- [chef] dynamically setting attributes, Jenn Fountain, 02/10/2014
Archive powered by MHonArc 2.6.16.