Can I run
chef-shell as chef-client when my chef-client is running in chef-zero (chef-local) mode?
The parameter used to run
chef-client in zero mode is
-z. However using
chef-shell just makes it run in chef-client mode...
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
You need to start chef-zero as it's own process, and then point chef-shell's server config at the running chef-zero.
See this example:
In one terminal:
$ chef-zero >> Starting Chef Zero (v4.2.1)... >> WEBrick (v1.3.1) on Rack (v1.6.1) is listening at http://127.0.0.1:8889 >> Press CTRL+C to stop
In another terminal:
$ chef-shell -z -S http://localhost:8889
You could also create a new
client.rb file and use:
chef-shell -z -c /path/to/client.rb
Mike's answer is correct.
When doing this on test-kitchen nodes I use the following "script" which also populates the chef-zero with the necessary cookbooks, etc.
/opt/chef/bin/chef-zero -d cd /tmp/kitchen knife upload . -c client.rb knife upload . -c client.rb # because the first one sometimes fails chef-shell -z -c client.rb