0

For chef-solo, is it possible to pass the override attributes via command line?

Because sometimes the attribute is just adhoc decision and is diffent from host to host, e.g. hostname, we don't want to create a json file for the sake of adhoc configuration.

Ryan
  • 5,341
  • 21
  • 71
  • 87

1 Answers1

1

You can use the -j command line option in order to define attributes you may want to override the default ones.

If you want to directly define the options via text, you can use the input redirection feature of bash like:

chef-solo -j <(echo '{ "tags": "awesome" }' )
priestjim
  • 659
  • 3
  • 8
  • When using `-j`, you are required to open the file, update and save it. What I want is to provide the adhoc value from commandline. – Ryan Mar 16 '13 at 03:38
  • It does not work, see: http://tickets.opscode.com/browse/CHEF-4405 – Ryan Jul 26 '13 at 11:18