I run the following command:
chef-client --local-mode -j deploy-backend.json
The JSON file contains:
{
"run-list" : [
"deploy-dev::sysprepare",
"deploy-dev::deploybackend",
"deploy-dev::deploynginx"
]
}
Now the problem is: the chef-client command succeeds, but at the end a FATAL error occurs after running the recipes:
$ sudo chef-client --local-mode -j cookbooks/deploy-backend.json
[2017-07-13T13:19:11+02:00] WARN: No config file found or specified on command line, using command line options.
Starting Chef Client, version 13.2.20
resolving cookbooks for run list: ["deploy-dev::sysprepare", "deploy-dev::deploybackend", "deploy-dev::deploynginx"]
Synchronizing Cookbooks:
- deploy-dev (0.1.0)
Installing Cookbook Gems:
Compiling Cookbooks...
Converging 29 resources
Recipe: deploy-dev::sysprepare
...
...
- reload service service[nginx]
Running handlers:
Running handlers complete
Chef Client finished, 11/33 resources updated in 01 minutes 32 seconds
[2017-07-13T13:20:43+02:00] WARN: No config file found or specified on command line, using command line options.
[2017-07-13T13:20:43+02:00] WARN: No config file found or specified on command line, using command line options.
[2017-07-13T13:20:43+02:00] FATAL: Cannot load configuration from cookbooks/deploy-backend.json
[2017-07-13T13:20:43+02:00] FATAL: Cannot load configuration from cookbooks/deploy-backend.json
I missed most of the output, "reload service service [nginx]" is the last resource on the list. I checked manually that the recipes are working correctly, but I get this FATAL error at the end (this is called from a CI job, so the CI pipeline ends because of this).
This is strange, as the recipes went well. I am using chef-client version 13.2.20. If I use version 12 of the chef-client, this works fine. Also, if I just pass the list:
chef-client --local-mode -r "deploy-dev::sysprepare,deploy-dev::deploybackend,deploy-dev::deploynginx"
It is performed correctly. Does anyone know what is going on here?