chef / chef-apply

The ad-hoc execution tool for the Chef ecosystem.
https://www.chef.sh/
Apache License 2.0
14 stars 14 forks source link

[SHACK-295] Chef 13 on Linux requires absolute paths for config location #9

Closed tyler-ball closed 6 years ago

tyler-ball commented 6 years ago

Different version of Chef (13/14) all behave differently on different OSes (*nix, Windows) when it comes to specifying the chef-client --config option. See the comment in this change for details.

Chef throws the following error on *nix:

sudo chef-client -z --config workstation.rb --recipe-url cw_directory_policy-03eb35d4ce71236f6ccd809d1feec5412eaa22e9ed79bcda34e4c04a7e4faf76.tgz
Starting Chef Client, version 13.10.0
resolving cookbooks for run list: []
Synchronizing Cookbooks:
Installing Cookbook Gems:
Compiling Cookbooks...
[2018-07-13T22:08:38+00:00] WARN: Node ubuntu1 has an empty run list.
Converging 0 resources

Running handlers:
  - ChefApply::Reporter
Running handlers complete
Chef Client finished, 0/0 resources updated in 01 seconds
[2018-07-13T22:08:38+00:00] WARN: *****************************************
[2018-07-13T22:08:38+00:00] WARN: Did not find config file: /workstation.rb, using command line options.
[2018-07-13T22:08:38+00:00] WARN: *****************************************
[2018-07-13T22:08:38+00:00] FATAL: You specified --recipe-url but the value is neither a valid URL nor a path to a file that exists on disk.Please confirm the location of the tarball and try again.

It does not seem to recognize the arguments to --config or --recipe-url as relative paths, they must be absolute

Signed-off-by: tyler-ball tball@chef.io