gliptak
gliptak

Reputation: 3670

chef setting (default) attributes when using knife node from file

I'm using a JSON file to configure a (already bootstrapped) node, and trying to identify the right syntax to set node specific attributes. Here is the JSON file used:

{
  "name": "mynode",
  "run_list": [
    "snmp"
  ],
  "default_attributes": {
    "server_url": "http://mynode/",
    "interval": "20"
  },
  "normal": {
    "tags": [

    ]
  }
}

Commands (note attributes not showing in last command results):

>knife --version
Chef: 12.9.41
>knife node from file .\mynode.json
Updated Node mynode
>knife node show mynode
Node Name:   mynode
Environment: _default
FQDN:
IP:
Run List:    recipe[snmp]
Roles:
Recipes:
Platform:
Tags:

What would be the right syntax to set default/normal/overridden attributes on the node?

Thanks

Upvotes: 0

Views: 1569

Answers (1)

coderanger
coderanger

Reputation: 54249

You cannot set default/override attributes in a node, only normal. The syntax for knife node from file is what you have there (minus the default_attributes which does nothing).

Upvotes: 1

Related Questions