- From: Daniel DeLeo <
>
- To:
- Subject: [chef] Re: Re: Re: Re: Re: Re: Re: mysql and root password
- Date: Mon, 16 Apr 2012 09:14:57 -0700
On Monday, April 16, 2012 at 8:21 AM, S Ahmed wrote:
>
I've read only about setting default_attributes or override in a role, how
>
do I set a 'normal' attribute?
>
>
BTW, what if I am setting multiple attributes, do I just wrap it in [ .. ]
>
? i.e.
>
>
default_attributes [
>
"mysql" => {},
>
"abc" => { }
>
]
Normal attributes belong to individual nodes, and are intended to be used for
settings that are unique to that node. In general, you should have very few
of these, though generated passwords are one use case.
When using Chef in a client/server configuration, normal attributes are
preserved, while default and override attributes are recomputed from
cookbooks and roles on each run. This is why the MySQL cookbook sets the
password as a normal attribute on the node.
For your use case, with chef-solo, you can probably just set the desired
value as an attribute in your JSON attributes file (that is, the one you pass
in via the `-j` command line option). If you'd rather use a role, you have to
either remove the password generation code from the cookbook, or set an
override attribute.
HTH,
--
Dan DeLeo
Archive powered by MHonArc 2.6.16.