Chef-role


#1

HI,

Can anybody send answer how to do chef-client and its json file for
overriding attributes which we need to run from our workstation to a target
node

Thanks,
Indra


#2

It’s part of the bootstrap process; add --json-attributes to your knife command along with the a string of json to be passed as attributes.

knife bootstrap --json-attributes ‘{“nginx”: {“whatever”: false} }’

As long as your bootstrap template includes logic[0] to write that to the remote filesystem and call chef-client with -j the attributes will be applied. Avoid using “override” in your json attributes unless you absolutely need it.

[0] https://github.com/opscode/chef/blob/master/lib/chef/knife/bootstrap/chef-full.erb#L69-71

On Monday, May 12, 2014 at 6:52 AM, indra.k@cloudenablers.com wrote:

HI,

Can anybody send answer how to do chef-client and its json file for
overriding attributes which we need to run from our workstation to a target
node

Thanks,
Indra