Add json_attributes: true
config option to ChefZero provisioner.
#280
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This option allows a user to invoke chef-client without passing the
generated JSON file in the
--json-attributes
option. That way if youhave a JSON definition of your node (including a run-list), the
chef-client run will depend entirely on what is on the "Chef Server".
For example, let's assume we want a node called "mynode" to be in the
"production" chef environment. Given a .kitchen.yml with the following:
and an environment JSON description for our chef environment called
"production" in
test/integration/environments/production.json
thatlooks like:
and a node JSON description for our node called "mynode" in
test/integration/nodes/mynode.json
that looks like:then the instance will attempt to register with the Chef Zero server as
"mynode" (vs. "default-ubuntu-1204" in this case) and will receive a
run-list of
["recipe[nginx]"]
from the server. Additionally thefollowing node attributes will be setup:
node[:some_attr]
will be set to"hello"
node[:myenv_attr]
will be set to"Good to be in prod"
node[:ipaddress]
will be set to"192.168.77.77"
Note that the node JSON format assumes a Chef 11 serialized format which
Chef Zero will use under the hood. For more details, please read:
http://docs.opscode.com/essentials_node_object.html