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.
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
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)
:
$ 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
$ 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)
:
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.
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.
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
PGP/GnuPG Key ID: 0x0C8EDD02