I am working in chef.My queries are:::::::::::
a) when iam running a chef-client in a target node and
passing attribute values in a json file for overriding like:
chef-client -j sample.json
here sample.json is something an attribute which we need to override in our
recipe .Its working fine
But my question is Is this possible to run chef-client json attributes by
passing as a json runtime parameters without creating attributes in a json file
why am asking is if we want to pass a single attribute we need to create a json
file and need to pass those just for a single attributes.so only asking is
there any option in that for running a chef client override attributes as a
runtime parameters.
But my question is Is this possible to run chef-client json attributes by
passing as a json runtime parameters without creating attributes in a json file
why am asking is if we want to pass a single attribute we need to create a json
file and need to pass those just for a single attributes.so only asking is
there any option in that for running a chef client override attributes as a
runtime parameters.
No, you cannot pass JSON on the command line. CHEF-1918 represents the
feature request.
I think this was originally the design because it would be a bit of a
complicated syntax to type and quote, so it wouldn't be easy to use,
and making another syntax, e.g. foo=bar, baz[faz][jaz]=stuff, would
also be complicated and probably limiting.
Is the attribute value that you're trying to pass changing often? Is
it something you could dynamically configure from other information?
If it's something only a human could provide that always goes into the
same attribute, maybe read it out of an environment variable in a
recipe and run like this:
But my question is Is this possible to run chef-client json attributes by
passing as a json runtime parameters without creating attributes in a json file
why am asking is if we want to pass a single attribute we need to create a json
file and need to pass those just for a single attributes.so only asking is
there any option in that for running a chef client override attributes as a
runtime parameters.
No, you cannot pass JSON on the command line. CHEF-1918 represents the
feature request.
I think this was originally the design because it would be a bit of a
complicated syntax to type and quote, so it wouldn't be easy to use,
and making another syntax, e.g. foo=bar, baz[faz][jaz]=stuff, would
also be complicated and probably limiting.
Is the attribute value that you're trying to pass changing often? Is
it something you could dynamically configure from other information?
If it's something only a human could provide that always goes into the
same attribute, maybe read it out of an environment variable in a
recipe and run like this: