- From: "John E. Vincent (lusis)" <
>
- To:
- Subject: [chef] Re: Re: Re: Re: Arbitrary attributes for nodes
- Date: Tue, 15 Feb 2011 11:01:21 -0500
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:reply-to:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=Nj+1d4su4spoWI1maVlQdRquFTAhu59d7ktAi7BQxX0QDK/stRL64dMP8ui0N4ZOgy BYFugAdy74wYG/nNnGu59lPhm0VqDS7qDUrZfK2Krwcu60d5kspwCC3LK5GrGSN1OYyW wpY0uVAxtep8sJrs04ae74853DM2iojVcW38Q=
Forgot to CC list:
You can. Add the override to "normal", IIRC. I've been using roles for
pretty much everything.
On Tue, Feb 15, 2011 at 10:55 AM, Tristan Sloughter
<
>
wrote:
>
Ah ok, thanks! That works and while I was hoping to just be able to set
>
attributes per node with creating new roles for them as long as it works I'm
>
happy :)
>
>
On Tue, Feb 15, 2011 at 9:53 AM, John E. Vincent (lusis)
>
<
>
>
wrote:
>
>
>
> Right sorry. I had those overwritten at the role level
>
>
>
> ~/development/chef-repo$ knife role show mysql_master
>
> {
>
> "name": "mysql_master",
>
> "description": "MySQL Master Server",
>
> "json_class": "Chef::Role",
>
> "default_attributes": {
>
> },
>
> "override_attributes": {
>
> "mysql": {
>
> "manage_users": true
>
> }
>
> },
>
> "chef_type": "role",
>
> "run_list": [
>
> "role[base]",
>
> "recipe[users::mysql]",
>
> "recipe[mysql::munin]"
>
> ]
>
> }
>
>
>
> On Tue, Feb 15, 2011 at 10:47 AM, Tristan Sloughter
>
> <
>
>
> wrote:
>
> > Hmm, so yes adding the default.rb to attributes works for the default
>
> > values. But adding to override does not actual override. I'm still
>
> > getting 0
>
> > (which I placed in default.rb instead of 1 which I placed in override).
>
> > Could there be a reason that its not updating the information on the
>
> > client
>
> > when run?
>
> > Tristan
>
> > On Tue, Feb 15, 2011 at 9:40 AM, John E. Vincent (lusis)
>
> > <
>
>
> > wrote:
>
> >>
>
> >> In override?
>
> >>
>
> >> ~/development/chef-repo$ knife node show db3
>
> >> <snip>
>
> >> "override": {
>
> >> "mysql": {
>
> >> "manage_users": true
>
> >> }
>
> >> },
>
> >> "run_list": [
>
> >> "role[mysql_master]"
>
> >> ]
>
> >> }
>
> >>
>
> >> ~/development/chef-repo$ knife node show db3slave3
>
> >> <snip>
>
> >> "override": {
>
> >> },
>
> >> "run_list": [
>
> >> "role[mysql_slave]"
>
> >> ]
>
> >> }
>
> >>
>
> >> ~/development/chef-repo/site-cookbooks/users/attributes$ cat default.rb
>
> >> default[:mysql][:manage_users] = false
>
> >>
>
> >> On Tue, Feb 15, 2011 at 10:11 AM, Tristan Sloughter
>
> >> <
>
>
> >> wrote:
>
> >> > But where is that done? I saw this in the training slides... I want
>
> >> > it
>
> >> > done
>
> >> > per node with different values so I was hoping I could simply place
>
> >> > it
>
> >> > in
>
> >> > the nodes attributes.
>
> >> > Tristan
>
> >> >
>
> >> > On Tue, Feb 15, 2011 at 9:10 AM, Sean OMeara
>
> >> > <
>
>
> >> > wrote:
>
> >> >>
>
> >> >> node.set[:num] = 1
>
> >> >>
>
> >> >> On Tue, Feb 15, 2011 at 10:03 AM, Tristan Sloughter
>
> >> >> <
>
>
> >> >> wrote:
>
> >> >> > Maybe I'm missing something but the wiki pages on attributes and
>
> >> >> > their
>
> >> >> > use
>
> >> >> > in roles, nodes and recipes is confusing me.
>
> >> >> > I'd simply like to be able to set arbitrary attributes on a node
>
> >> >> > that
>
> >> >> > can be
>
> >> >> > used in a recipe.
>
> >> >> > Meaning somewhere in the node's json place something like, { "num"
>
> >> >> > :
>
> >> >> > "1"
>
> >> >> > }
>
> >> >> > And be able to access this in any recipe the node is running like
>
> >> >> > node[:num].
>
> >> >> > Is this not possible? I tried placing key/values under default
>
> >> >> > through a
>
> >> >> > knife edit of the node but my attempts to access the values in a
>
> >> >> > recipe
>
> >> >> > returns nil.
>
> >> >> > Thanks,
>
> >> >> > Tristan
>
> >> >
>
> >> >
>
> >
>
> >
>
>
Archive powered by MHonArc 2.6.16.