I know we can pass node attributes in chef-{client/solo} with --json-attributes(-j) flag. This flag always expect a JSON file as input. Is their any method I can directly pass the attributes as JSON objects.
I tried doing it. For eg:
chef-client -j {"attr":"value"}
But it ends up with a failure message as:
FATAL: I cannot find {"attr":"value"}
As it expects a JSON file. I need to pass JSON objects as in our env I can't create a json file. I don't want to use attributes/role/environment files as well. Is there any other way to pass the attributes ?
Have you tried piping the JSON to STDIN?
echo '{"attr":"value"}' | chef-client -j /dev/stdin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With