While trying out environments in chef, I tried some steps as mentioned below
for better understanding usage of environments but could not get why the result
was something different then what I expected.
Here is what I have tried :
I have a recipe. consisting variable x = 5 defined in attributes/attr.rb
Then, I created a environment named “testing” for my cookbook named “try”.
In this newly created environment, I have specified overirde_attributes
variable x=10
We know that “knife node edit <node_name>” command can be used to edit the
details of a node. So, moving ahead I edited environment attribute of node
"client_one" from “_default” to that “testing”
Now, my expectation was that if I execute recipe “try” against this node it
should read and print the value of x as 10 but output printed was 5.
Please let me know how the execution in this scenario does not read value of
variable x from environment.
While trying out environments in chef, I tried some steps as mentioned
below
for better understanding usage of environments but could not get why the
result
was something different then what I expected.
Here is what I have tried :
I have a recipe. consisting variable x = 5 defined in attributes/attr.rb
Then, I created a environment named "testing" for my cookbook named
"try".
In this newly created environment, I have specified overirde_attributes
variable x=10
We know that "knife node edit <node_name>" command can be used to edit
the
details of a node. So, moving ahead I edited environment attribute of node
"client_one" from "_default" to that "testing"
Now, my expectation was that if I execute recipe "try" against this
node it
should read and print the value of x as 10 but output printed was 5.
Please let me know how the execution in this scenario does not read value
of
variable x from environment.
On Wednesday, August 6, 2014 at 10:31 AM, pratik_gadiya@persistent.co.in wrote:
Hi All,
While trying out environments in chef, I tried some steps as mentioned below
for better understanding usage of environments but could not get why the result
was something different then what I expected.
Here is what I have tried :
I have a recipe. consisting variable x = 5 defined in attributes/attr.rb
Then, I created a environment named "testing" for my cookbook named "try".
In this newly created environment, I have specified overirde_attributes
variable x=10
We know that "knife node edit <node_name>" command can be used to edit the
details of a node. So, moving ahead I edited environment attribute of node
"client_one" from "_default" to that "testing"
Now, my expectation was that if I execute recipe "try" against this node it
should read and print the value of x as 10 but output printed was 5.
Please let me know how the execution in this scenario does not read value of
variable x from environment.
Thanks
Can you show us your recipe code and environments file?