How to set override attributes with "knife node edit"?


#1

I’m having trouble getting “knife node edit” to behave as expected.
I’m setting attributes on the key { “override”: … } within the JSON
data structure however my changes aren’t picked up during chef-client
runs–indeed after running chef-client the attributes disappear from
the data structure.

That is, if I change, say, “override.foo.servers” and save the file
the change is persisted to opscode in some way (if I immediately
re-edit, I can see the change I made) however if I run chef-client on
the node, it ignores the change I made, and somehow arranges for it to
be deleted.

How do the precedence “namespaces” within the “knife node edit” JSON
data structure work? How do they correspond to attributes in the
opscode web interface? (These have no precedence setting I can see–if
I change something in the opscode interface, I am changing its
"normal", “override” or “default” value?)

I’ve read through

http://wiki.opscode.com/display/chef/Attributes

several times, but it doesn’t explain what the “knife node edit” data
structure represents, and what will happen if you edit different
areas. (e.g. I assume editing the “automatic” section does nothing.)

Thanks,
Michael


#2

Attributes in the node definition should be set at the “normal” level.

Admittedly, the docs do a fairly poor job of indicating as much (using the
word “typically” implies that other approaches are possible).

Sun, Mar 6, 2011 at 2:08 PM, Michael Stillwell mjs@beebo.org wrote:

I’m having trouble getting “knife node edit” to behave as expected.
I’m setting attributes on the key { “override”: … } within the JSON
data structure however my changes aren’t picked up during chef-client
runs–indeed after running chef-client the attributes disappear from
the data structure.

That is, if I change, say, “override.foo.servers” and save the file
the change is persisted to opscode in some way (if I immediately
re-edit, I can see the change I made) however if I run chef-client on
the node, it ignores the change I made, and somehow arranges for it to
be deleted.

How do the precedence “namespaces” within the “knife node edit” JSON
data structure work? How do they correspond to attributes in the
opscode web interface? (These have no precedence setting I can see–if
I change something in the opscode interface, I am changing its
"normal", “override” or “default” value?)

I’ve read through

http://wiki.opscode.com/display/chef/Attributes

several times, but it doesn’t explain what the “knife node edit” data
structure represents, and what will happen if you edit different
areas. (e.g. I assume editing the “automatic” section does nothing.)

Thanks,
Michael


#3

The table at the top of the attributes documentation also strongly
suggests that setting “override” or “default” precedence on a node
will have an affect and/or be useful–there’s a column headed “Node or
Recipe”, and the corresponding “override” row gives it the highest
possible precedence, so it was a bit surprising to discover that
"override" on a node actually does nothing.

See

http://wiki.opscode.com/display/chef/Attributes#Attributes-SettingAttributes

Michael

On Sun, Mar 6, 2011 at 9:28 PM, Charles Duffy charles@dyfis.net wrote:

Attributes in the node definition should be set at the “normal” level.
Admittedly, the docs do a fairly poor job of indicating as much (using the
word “typically” implies that other approaches are possible).
Sun, Mar 6, 2011 at 2:08 PM, Michael Stillwell mjs@beebo.org wrote:

I’m having trouble getting “knife node edit” to behave as expected.
I’m setting attributes on the key { “override”: … } within the JSON
data structure however my changes aren’t picked up during chef-client
runs–indeed after running chef-client the attributes disappear from
the data structure.

That is, if I change, say, “override.foo.servers” and save the file
the change is persisted to opscode in some way (if I immediately
re-edit, I can see the change I made) however if I run chef-client on
the node, it ignores the change I made, and somehow arranges for it to
be deleted.

How do the precedence “namespaces” within the “knife node edit” JSON
data structure work? How do they correspond to attributes in the
opscode web interface? (These have no precedence setting I can see–if
I change something in the opscode interface, I am changing its
"normal", “override” or “default” value?)

I’ve read through

http://wiki.opscode.com/display/chef/Attributes

several times, but it doesn’t explain what the “knife node edit” data
structure represents, and what will happen if you edit different
areas. (e.g. I assume editing the “automatic” section does nothing.)

Thanks,
Michael