3

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 -z with chef-shell just makes it run in chef-client mode...

Merlijn Sebrechts
  • 369
  • 1
  • 4
  • 14

2 Answers2

1

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 Fiedler
  • 2,152
  • 1
  • 17
  • 33
0

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

I've created a feature request for simplifying this which you may wish to vote for.

chicks
  • 3,639
  • 10
  • 26
  • 36