# Knife zero plugin doesn't work on chef 12.x

**URL:** <https://discourse.chef.io/t/knife-zero-plugin-doesnt-work-on-chef-12-x/6114>\
**Category:** Chef Infra (archive)\
**Created:** [December 24, 2014, 5:28am UTC](https://discourse.chef.io/t/knife-zero-plugin-doesnt-work-on-chef-12-x/6114 "2014-12-24T05:28:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tsuyoshi\_Ushio](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/tsuyoshi_ushio/32/182_2.png) [@Tsuyoshi\_Ushio](https://discourse.chef.io/u/Tsuyoshi_Ushio)\
**Post date:** [December 24, 2014, 5:28am UTC](https://discourse.chef.io/t/knife-zero-plugin-doesnt-work-on-chef-12-x/6114/1 "2014-12-24T05:28:11Z")

</div>

Hi Chefs,

I'm trying knife zero plugin.

But it doesn't work on chef 12.x but it works on chef 11.x.

Can I use knife zero plugin on chef 12.x?  
or Anything wrong with my procedure?

Knife zero's author seems to remove the dependency on purpose.

> <https://github.com/higanworks/knife-zero/commit/927edbd6c281f3e7448a4e210949f1fa5e71557d>

# Case A : chef 12.x

* * *

chef generate repo test cd test  
 mkdir .chef vi Gemfile  
 bundle install echo "local\_mode true" \>\> .chef/knife.rb  
$ bundle exec knife zero bootstrap test\_ubuntu -x vagrant --sudo  
Connecting to test\_ubuntu  
ERROR: knife encountered an unexpected error  
This may be a bug in the 'zero bootstrap' knife command or plugin  
Please collect the output of this command with the `-VV` option before  
filing a bug report.  
Exception: NameError: undefined local variable or method `chef\_version' for  
#Chef::Knife::Core::BootstrapContext:0x007fe716eab550

## [http://tcotav.github.io/chefdk\_getting\_started.html](http://tcotav.github.io/chefdk_getting_started.html)

## ---Gemfile gem "chef" gem "knife-zero" gem "berkshelf"

## ---Gemfile.lock : chef (12.0.3) chef-zero (~\> 3.2) :

# CaseB : chef 11.x

I changed Gemfile. Like this.

## ---Gemfile gem "chef", "11.16.4" gem "knife-zero" gem "berkshelf"

## Then it works.

## rm Gemfile.lock bundle install $ bundle exec knife zero bootstrap test\_ubuntu -x vagrant --sudo ffi-yajl/json\_gem is deprecated, these monkeypatches will be dropped shortly Connecting to test\_ubuntu test\_ubuntu Starting first Chef Client run... test\_ubuntu Starting Chef Client, version 11.8.2 test\_ubuntu resolving cookbooks for run list: test\_ubuntu Synchronizing Cookbooks: test\_ubuntu Compiling Cookbooks... test\_ubuntu [2014-12-24T05:08:50+00:00] WARN: Node vagrant-ubuntu-trusty-64 has an empty run list. test\_ubuntu Converging 0 resources test\_ubuntu Chef Client finished, 0 resources updated

## ---Gemfile.lock : chef (11.16.4) chef-zero (~\> 2.1, \>= 2.1.4) :

Regards,

Tsuyoshi

---

<div class="post-metadata">

**Author:** ![Tsuyoshi\_Ushio](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/tsuyoshi_ushio/32/182_2.png) [@Tsuyoshi\_Ushio](https://discourse.chef.io/u/Tsuyoshi_Ushio)\
**Post date:** [December 24, 2014, 7:36am UTC](https://discourse.chef.io/t/knife-zero-plugin-doesnt-work-on-chef-12-x/6114/2 "2014-12-24T07:36:20Z")

</div>

Hi Chefs,

This problem was quickly fixed by the author of knife zero.

Now it has been updated and no problem.

Thanks.

On 24 December 2014 at 14:28, Tsuyoshi Ushio [ushio@simplearchitect.com](mailto:ushio@simplearchitect.com)  
wrote:

> Hi Chefs,
> 
> I'm trying knife zero plugin.
> 
> But it doesn't work on chef 12.x but it works on chef 11.x.
> 
> Can I use knife zero plugin on chef 12.x?  
> or Anything wrong with my procedure?
> 
> Knife zero's author seems to remove the dependency on purpose.
> 
> [remove dependency of chef version · higanworks/knife-zero@927edbd · GitHub](https://github.com/higanworks/knife-zero/commit/927edbd6c281f3e7448a4e210949f1fa5e71557d)
> 
> # Case A : chef 12.x
> 
> * * *
> 
> $ chef generate repo test  
> $ cd test  
> $ mkdir .chef  
> $ vi Gemfile  
> $ bundle install  
> $ echo "local\_mode true" \>\> .chef/knife.rb  
> $ bundle exec knife zero bootstrap test\_ubuntu -x vagrant --sudo  
> Connecting to test\_ubuntu  
> ERROR: knife encountered an unexpected error  
> This may be a bug in the 'zero bootstrap' knife command or plugin  
> Please collect the output of this command with the `-VV` option before  
> filing a bug report.  
> Exception: NameError: undefined local variable or method `chef\_version'  
> for #Chef::Knife::Core::BootstrapContext:0x007fe716eab550
> 
> ## [The Official Unofficial Getting Started with ChefDK Guide](http://tcotav.github.io/chefdk_getting_started.html)
> 
> ## ---Gemfile gem "chef" gem "knife-zero" gem "berkshelf"
> 
> ## ---Gemfile.lock : chef (12.0.3) chef-zero (~\> 3.2) :
> 
> # CaseB : chef 11.x
> 
> I changed Gemfile. Like this.
> 
> ## ---Gemfile gem "chef", "11.16.4" gem "knife-zero" gem "berkshelf"
> 
> ## Then it works.
> 
> ## $ rm Gemfile.lock $ bundle install $ bundle exec knife zero bootstrap test\_ubuntu -x vagrant --sudo ffi-yajl/json\_gem is deprecated, these monkeypatches will be dropped shortly Connecting to test\_ubuntu test\_ubuntu Starting first Chef Client run... test\_ubuntu Starting Chef Client, version 11.8.2 test\_ubuntu resolving cookbooks for run list: test\_ubuntu Synchronizing Cookbooks: test\_ubuntu Compiling Cookbooks... test\_ubuntu [2014-12-24T05:08:50+00:00] WARN: Node vagrant-ubuntu-trusty-64 has an empty run list. test\_ubuntu Converging 0 resources test\_ubuntu Chef Client finished, 0 resources updated
> 
> ## ---Gemfile.lock : chef (11.16.4) chef-zero (~\> 2.1, \>= 2.1.4) :
> 
> Regards,
> 
> Tsuyoshi

---

<div class="post-metadata">

**Author:** ![Taras\_Klym](https://avatars.discourse-cdn.com/v4/letter/t/f08c70/32.png) [@Taras\_Klym](https://discourse.chef.io/u/Taras_Klym)\
**Post date:** [December 24, 2014, 11:57am UTC](https://discourse.chef.io/t/knife-zero-plugin-doesnt-work-on-chef-12-x/6114/3 "2014-12-24T11:57:59Z")

</div>

Hi guys, I have configured chef-client (windows platform) on my nodes to be run as a service. Using chef-service-manager util from CMD. Now I would like to change run interval from 1800 seconds to 900 ro any other value. I downloaded chef-client cookbook and created recipe as follow: node.default[“chef\_client”][“interval”] = ‘900’ node.default[“chef\_client”][“splay”] = ‘100’ I included chef-client cookbook in my cookbooks’s metadata.rb file as follow: Depends ‘chef-client’ Just for changing those values. But it doesn’t seem to take any affect. What I am doing wrong? Thank you in advance for your advises.  
Regards, Taras.

---

<div class="post-metadata">

**Author:** ![Taras\_Klym](https://avatars.discourse-cdn.com/v4/letter/t/f08c70/32.png) [@Taras\_Klym](https://discourse.chef.io/u/Taras_Klym)\
**Post date:** [December 25, 2014, 1:48pm UTC](https://discourse.chef.io/t/knife-zero-plugin-doesnt-work-on-chef-12-x/6114/4 "2014-12-25T13:48:48Z")

</div>

Hi guys, I have configured chef-client (windows platform) on my nodes to be run as a service. Using chef-service-manager util from CMD. Now I would like to change run interval from 1800 seconds to 900 ro any other value. I downloaded chef-client cookbook and created recipe as follow: node.default[“chef\_client”][“interval”] = ‘900’ node.default[“chef\_client”][“splay”] = ‘100’ I included chef-client cookbook in my cookbooks’s metadata.rb file as follow: Depends ‘chef-client’ Just for changing those values. But it doesn’t seem to take any affect. What I am doing wrong? Thank you in advance for your advises.  
Regards, Taras.

---

<div class="post-metadata">

**Author:** ![Jeff\_Blaine](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jeff_blaine/32/19_2.png) [@Jeff\_Blaine](https://discourse.chef.io/u/Jeff_Blaine)\
**Post date:** [December 27, 2014, 11:02pm UTC](https://discourse.chef.io/t/knife-zero-plugin-doesnt-work-on-chef-12-x/6114/5 "2014-12-27T23:02:06Z")

</div>

On 12/25/2014 8:48 AM, [klum\_tz@ukr.net](mailto:klum_tz@ukr.net) wrote:

> ```
> Hi guys,
> 
> I have configured chef-client (windows platform) on my nodes to be
> run as a service.
> 
> Using chef-service-manager util from CMD.
> 
> Now I would like to change run interval from 1800 seconds to 900 ro
> any other value.
> 
> I downloaded chef-client cookbook and created recipe as follow:
> 
> node.default["chef_client"]["interval"] = '900'
> 
> node.default["chef_client"]["splay"] = '100'
> 
> I included chef-client cookbook in my cookbooks’s metadata.rb file
> as follow:
> 
> Depends ‘chef-client’
> 
> Just for changing those values.
> 
> But it doesn’t seem to take any affect.
> 
> What I am doing wrong?
> 
> ```

The 'depend' line is 1 step of 2. You need to also call the appropriate  
chef-client cookbook recipe from your cookbook. Just a 'depend' in the  
metadata of your cookbook does not trigger any action on the node.

--  
Jeff Blaine  
[kickflop.net](http://kickflop.net)  
PGP/GnuPG Key ID: 0x0C8EDD02
