- From: "Julian C. Dunn" <
>
- To:
- Subject: [chef] Re: Re: Re: [Chef] Attribute precedence and Persistence issue.
- Date: Sat, 23 Nov 2013 12:18:33 -0500
On Sat, Nov 23, 2013 at 12:15 AM, Mrigesh Priyadarshi
<
>
wrote:
>
Our use case is that we have a service portal and we want end users to
>
provision their instance with custom configuration. We want to have a
>
default configuration in cookbook so, if the user doesnt select any custom
>
config for the installs the service portal will not generate any json file.
>
And will run the chef-client with default values defined in cookbook but if
>
they select any configuration chef-client should include those with the json
>
file.
>
>
In this scenario, what ever value we pass through the attrib file gets
>
persisted as normal type and doesnt get reset in the next run if the json
>
file is not passed.
Hi Mrigesh,
You might need to take a different approach then. As I mentioned, you
can think of Chef as being a "desired state" system, so persistence is
designed into it.
It would be better if, through your service portal, the user's
instance were assigned a certain Chef Role that contains all the
attributes pertinent to that role. Then, through the magic of
attribute precedence, those values will be the ones used by the system
instead of the defaults you defined in the cookbook.
http://docs.opscode.com/essentials_cookbook_attribute_files.html
I hope that helps.
- Julian
--
[ Julian C. Dunn
<
>
* Sorry, I'm ]
[ WWW:
http://www.aquezada.com/staff/julian * only Web 1.0 ]
[
gopher://sdf.org/1/users/keymaker/ * compliant! ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]
Archive powered by MHonArc 2.6.16.