popularity question answers views user  
1
Knife ssh not work when a node is not bootstrapped

I have a node which is registered to chef server when its first time run the chef-client, so I can see the node in the web interface.

But I can’t run knife ssh to it, return error

“Net::SSH::AuthenticationFailed”

So, in this case, what is the best way to copy the ssh key?

more →
1 486  
1
knife command not working

hi , Knife command throwing error below . /usr/bin/knife:22:in `require': no such file to load — chef/application/knife (LoadError)

from /usr/bin/knife:22

How to solve this ?

more →
0 71  
1
Mount a network drive to windows using Chef-solo

I need to mount a network drive on a windows vm. I am currently using chef solo to automate the process.

This is what I have in my recipe file:

mount "W:" do
  action :mount
  device "\\\\blazer\\INTAPPS"
end

This does not work and I get the following error messages:

Unable to detect IP6Address ...
chef-client does not have administrator priviledges on node BESTVM.ms.otpp.net. This might cause unexpected resource failures....

I can manually map the drive on the windows vm, but then I need to provide a domain-name-qualified user name and password. Is there a way I can provide the domain name, user name, password to the mount resource? is there an alternate way to mount the drive using chef?

I also tried the following command (as suggested in http://docs.opscode.com/ctl_chef_client.html)

runas /user:my_user_name "cmd /C chef-client"

After I entered password, a window appears and then dissapears. So I don’t exactly know what is happenning in it.

I am an absolute new by to chef, so a detailed answer would be very much appreciated.

Thanks.

more →
2 45  
1
Opensource Chef 11 server behind a firewall

Hi,

I just upgraded our old Chef server to Chef 11, But I’m struggling to get my clients to reach the server. Our Chef-server is hosted internally, while our clients are in the cloud. Between them there’s a firewall that blocks all connections from the internet to the internal network.

Since Chef-client now connects to port 80 or 443, I’m unable to setup a portforward to Chef-client to work without exposing the Chef Webinterface.

Is there a way to tell Chef to use other ports for all communication? I tried setting the following in chef-server.rb. But this works only halve, the clients are added to the node-list, but the cookbook transfer fails because it wants to connect to https://chef-server.tld/bookshelf/organization….

nginx['non_ssl_port'] = 8140
nginx['enable_non_ssl'] = true

Any ideas?

more →
0 8  
0
Chef::Handler::ErrorReport raised #<JSON::NestingError: nesting of 1000 is too deep>

Hello everyone, I came across an JSON error “JSON::NestingError: nesting of 1000 is too deep” when executing ‘sudo chef-client’ to setup a ubuntu-10-04-server-i386 machine as a hadoop name node. I ran cluster_chef on the my chef workstation node to launch and bootstrap the ubuntu node, then get the same error log reported when executing ‘sudo chef-client’ on the node it self. For debugging, I only add 2 “recipes [recipe[cluster_chef::dedicated_server_tuning], recipe[hadoop_cluster::namenode]] ” for the node.

Did anyone encounter this kind of issue and give some tips? Thanks in advance!!

———– ENV of the Ubuntun Node ———–

   Linux ubuntu-vm 2.6.32-33-generic-pae #70-Ubuntu SMP Thu Jul 7 22:51:12 UTC 2011 i686 GNU/Linux ruby 1.8.7
   (2010-01-10 patchlevel 249)
   [i486-linux] json (1.6.1) chef
   (0.10.8) ohai (0.6.10) Cookbook
   hadoop_cluster version is 0.9.7
   Cookbook hadoop version is 0.8.1
   Cookbook cluster_service_discovery is 0.1

—————-ERROR LOG ———–

ubuntu@ubuntu-vm:~$ sudo chef-client
[Fri, 27 Jan 2012 15:32:32 +0800] INFO: *** Chef 0.10.8 ***
[Fri, 27 Jan 2012 15:32:36 +0800] INFO: Run List is [recipe[cluster_chef::dedicated_server_tuning], recipe[hadoop_cluster::namenode]]
[Fri, 27 Jan 2012 15:32:36 +0800] INFO: Run List expands to [cluster_chef::dedicated_server_tuning, hadoop_cluster::namenode]
[Fri, 27 Jan 2012 15:32:36 +0800] INFO: Starting Chef Run for demohadoop-master-0
[Fri, 27 Jan 2012 15:32:36 +0800] INFO: Running start handlers
[Fri, 27 Jan 2012 15:32:36 +0800] INFO: Start handlers complete.
[Fri, 27 Jan 2012 15:32:39 +0800] INFO: Loading cookbooks [apt, aws, cluster_chef, cluster_service_discovery, ebs, hadoop_cluster, java, ubuntu]
[Fri, 27 Jan 2012 15:32:39 +0800] WARN: Missing gem 'right_aws'
[Fri, 27 Jan 2012 15:32:39 +0800] INFO: Couldn't set performance parameters from instance type, estimating from 1 cores and 1026096 ram
[Fri, 27 Jan 2012 15:32:39 +0800] INFO: Registering to provide demohadoop-namenode: {}
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: Running exception handlers
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: Report handler Chef::Handler::ErrorReport raised #<JSON::NestingError: nesting of 1000 is too deep>
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/node.rb:501:in `to_json'
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/node.rb:501:in `to_json'
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/json-1.6.1/lib/json/common.rb:278:in `generate'
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/json-1.6.1/lib/json/common.rb:278:in `pretty_generate'
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/json_compat.rb:48:in `to_json_pretty'
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/handler/error_report.rb:27:in `report'
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/handler.rb:218:in `run_report_unsafe'
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/handler.rb:206:in `run_report_safely'
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/handler.rb:112:in `run_exception_handlers'
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/handler.rb:111:in `each'
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/handler.rb:111:in `run_exception_handlers'
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/handler.rb:119
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/client.rb:110:in `call'
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/client.rb:110:in `run_failed'
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/client.rb:109:in `each'
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/client.rb:109:in `run_failed'
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/client.rb:170:in `run'
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/application/client.rb:239:in `run_application'
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/application/client.rb:229:in `loop'
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/application/client.rb:229:in `run_application'
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/application.rb:67:in `run'
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/chef-client:26
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: /usr/bin/chef-client:19:in `load'
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: /usr/bin/chef-client:19
[Fri, 27 Jan 2012 15:32:39 +0800] ERROR: Exception handlers complete
[Fri, 27 Jan 2012 15:32:39 +0800] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[Fri, 27 Jan 2012 15:32:39 +0800] FATAL: JSON::NestingError: nesting of 1000 is too deep

ubuntu@ubuntu-vm:~$ cat /var/chef/cache/chef-stacktrace.out
Generated at Fri Jan 27 15:32:39 +0800 2012
JSON::NestingError: nesting of 1000 is too deep
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/node.rb:501:in `to_json'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/node.rb:501:in `to_json'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/json_compat.rb:44:in `to_json'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/rest.rb:219:in `api_request'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/rest.rb:130:in `put_rest'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/node.rb:626:in `save'
/var/chef/cache/cookbooks/cluster_service_discovery/libraries/cluster_service_discovery.rb:73:in `provide_service'
/var/chef/cache/cookbooks/hadoop_cluster/recipes/namenode.rb:31:in `from_file'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/cookbook_version.rb:578:in `load_recipe'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/mixin/language_include_recipe.rb:40:in `include_recipe'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/mixin/language_include_recipe.rb:27:in `each'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/mixin/language_include_recipe.rb:27:in `include_recipe'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/run_context.rb:72:in `load'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/run_context.rb:69:in `each'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/run_context.rb:69:in `load'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/client.rb:195:in `setup_run_context'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/client.rb:159:in `run'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/application/client.rb:239:in `run_application'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/application/client.rb:229:in `loop'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/application/client.rb:229:in `run_application'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/application.rb:67:in `run'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/chef-client:26
/usr/bin/chef-client:19:in `load'
/usr/bin/chef-client:19
------------------

After I set Chef::JSONCompat::JSON_MAX_NESTING to 0 in /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/json_compat.rb, and run “sudo chef-client”, it reports this error “SystemStackError: stack level too deep” :

—————-ERROR LOG ———–

ubuntu@ubuntu-vm:~$ sudo chef-client
[Fri, 27 Jan 2012 15:36:56 +0800] INFO: *** Chef 0.10.8 ***
[Fri, 27 Jan 2012 15:36:59 +0800] INFO: Run List is [recipe[cluster_chef::dedicated_server_tuning], recipe[hadoop_cluster::namenode]]
[Fri, 27 Jan 2012 15:36:59 +0800] INFO: Run List expands to [cluster_chef::dedicated_server_tuning, hadoop_cluster::namenode]
[Fri, 27 Jan 2012 15:36:59 +0800] INFO: Starting Chef Run for demohadoop-master-0
[Fri, 27 Jan 2012 15:36:59 +0800] INFO: Running start handlers
[Fri, 27 Jan 2012 15:36:59 +0800] INFO: Start handlers complete.
[Fri, 27 Jan 2012 15:37:02 +0800] INFO: Loading cookbooks [apt, aws, cluster_chef, cluster_service_discovery, ebs, hadoop_cluster, java, ubuntu]
[Fri, 27 Jan 2012 15:37:02 +0800] WARN: Missing gem 'right_aws'
[Fri, 27 Jan 2012 15:37:02 +0800] INFO: Couldn't set performance parameters from instance type, estimating from 1 cores and 1026096 ram
[Fri, 27 Jan 2012 15:37:02 +0800] INFO: Registering to provide demohadoop-namenode: {}
[Fri, 27 Jan 2012 15:37:02 +0800] ERROR: Running exception handlers
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: Report handler Chef::Handler::ErrorReport raised #<SystemStackError: stack level too deep>
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/mixin/params_validate.rb:85:in `set_or_return'
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/node.rb:230:in `chef_environment'
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/node.rb:491:in `to_json'
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/node.rb:501:in `to_json'
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/json-1.6.1/lib/json/common.rb:278:in `generate'
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/json-1.6.1/lib/json/common.rb:278:in `pretty_generate'
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/json_compat.rb:48:in `to_json_pretty'
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/handler/error_report.rb:27:in `report'
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/handler.rb:218:in `run_report_unsafe'
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/handler.rb:206:in `run_report_safely'
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/handler.rb:112:in `run_exception_handlers'
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/handler.rb:111:in `each'
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/handler.rb:111:in `run_exception_handlers'
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/handler.rb:119
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/client.rb:110:in `call'
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/client.rb:110:in `run_failed'
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/client.rb:109:in `each'
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/client.rb:109:in `run_failed'
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/client.rb:170:in `run'
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/application/client.rb:239:in `run_application'
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/application/client.rb:229:in `loop'
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/application/client.rb:229:in `run_application'
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/application.rb:67:in `run'
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/chef-client:26
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: /usr/bin/chef-client:19:in `load'
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: /usr/bin/chef-client:19
[Fri, 27 Jan 2012 15:37:03 +0800] ERROR: Exception handlers complete
[Fri, 27 Jan 2012 15:37:03 +0800] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[Fri, 27 Jan 2012 15:37:03 +0800] FATAL: SystemStackError: stack level too deep

ubuntu@ubuntu-vm:~$ cat /var/chef/cache/chef-stacktrace.out
Generated at Fri Jan 27 15:37:03 +0800 2012
SystemStackError: stack level too deep
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/mixin/params_validate.rb:86:in `set_or_return'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/node.rb:230:in `chef_environment'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/node.rb:491:in `to_json'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/node.rb:501:in `to_json'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/json_compat.rb:44:in `to_json'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/rest.rb:219:in `api_request'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/rest.rb:130:in `put_rest'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/node.rb:626:in `save'
/var/chef/cache/cookbooks/cluster_service_discovery/libraries/cluster_service_discovery.rb:73:in `provide_service'
/var/chef/cache/cookbooks/hadoop_cluster/recipes/namenode.rb:31:in `from_file'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/cookbook_version.rb:578:in `load_recipe'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/mixin/language_include_recipe.rb:40:in `include_recipe'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/mixin/language_include_recipe.rb:27:in `each'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/mixin/language_include_recipe.rb:27:in `include_recipe'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/run_context.rb:72:in `load'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/run_context.rb:69:in `each'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/run_context.rb:69:in `load'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/client.rb:195:in `setup_run_context'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/client.rb:159:in `run'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/application/client.rb:239:in `run_application'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/application/client.rb:229:in `loop'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/application/client.rb:229:in `run_application'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/application.rb:67:in `run'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/chef-client:26
/usr/bin/chef-client:19:in `load'
--------------------
more →
2 459  
0
How to use ark on a node

Hi,
i added the ark cookbook in the run list of my hosted chef node.
Now i want to use ark in another cookbook, that comes right after the ark cookbook.

I included the ark recipe in the recipe of the cookbook that comes right after the ark cookbook. The code looks like this:

include_recipe “ark”

dowloading olio

subversion “checkout-olio” do

repository "https://svn.apache.org/repos/asf/incubator/olio/"
revision "HEAD"
destination "/usr/local"
action :checkout

end

install faban

ark “install-faban” do

url "http://java.net/projects/faban/downloads/download/faban-kit/faban-kit-022311.tar.gz"
version "1.0"
path "/usr/local"
append_env_path true

end

When i upload this file and run the client the following error occurs: NoMethodError: undefined method `url' for Chef::Resource::Ark

Can somebody please tell me where the problem is?

more →
0 293  
0
application cookbook with node js

I have modified that opscode application cookbook to include support for node servers and applications. So far things have worked out pretty well and I only have one issue.

When I get to the point where the recipe should clone the repository from git I am prompted to enter the passphrase for the deploy key. The odd thing about this is no passphrase was created for this deploy key.

This is what I am seeing during provisioning:

ec2-23-20-232-88.compute-1.amazonaws.com [Thu, 19 Apr 2012 20:09:23 +0000] INFO: execute[npm] ran successfully 
ec2-23-20-232-88.compute-1.amazonaws.com [Thu, 19 Apr 2012 20:09:23 +0000] INFO: Processing directory[/data/shared] action create (application::node line 23) 
ec2-23-20-232-88.compute-1.amazonaws.com [Thu, 19 Apr 2012 20:09:23 +0000] INFO: directory[/data/shared] created directory /data/shared 
ec2-23-20-232-88.compute-1.amazonaws.com [Thu, 19 Apr 2012 20:09:23 +0000] INFO: directory[/data/shared] owner changed to 0 
ec2-23-20-232-88.compute-1.amazonaws.com [Thu, 19 Apr 2012 20:09:23 +0000] INFO: directory[/data/shared] group changed to 0 
ec2-23-20-232-88.compute-1.amazonaws.com [Thu, 19 Apr 2012 20:09:23 +0000] INFO: directory[/data/shared] mode changed to 755 
ec2-23-20-232-88.compute-1.amazonaws.com [Thu, 19 Apr 2012 20:09:23 +0000] INFO: Processing ruby_block[write_key] action create (application::node line 32) 
ec2-23-20-232-88.compute-1.amazonaws.com [Thu, 19 Apr 2012 20:09:23 +0000] INFO: ruby_block[write_key] called 
ec2-23-20-232-88.compute-1.amazonaws.com [Thu, 19 Apr 2012 20:09:23 +0000] INFO: Processing file[/data/id_deploy] action create (application::node line 41) 
ec2-23-20-232-88.compute-1.amazonaws.com [Thu, 19 Apr 2012 20:09:23 +0000] INFO: file[/data/id_deploy] mode changed to 600 
ec2-23-20-232-88.compute-1.amazonaws.com [Thu, 19 Apr 2012 20:09:23 +0000] INFO: Processing template[/data/deploy-ssh-wrapper] action create (application::node line 47) 
ec2-23-20-232-88.compute-1.amazonaws.com [Thu, 19 Apr 2012 20:09:23 +0000] INFO: template[/data/deploy-ssh-wrapper] mode changed to 755 
ec2-23-20-232-88.compute-1.amazonaws.com [Thu, 19 Apr 2012 20:09:23 +0000] INFO: template[/data/deploy-ssh-wrapper] updated content 
ec2-23-20-232-88.compute-1.amazonaws.com [Thu, 19 Apr 2012 20:09:23 +0000] INFO: Processing deploy_revision[node_app] action deploy (application::node line 57) 
ec2-23-20-232-88.compute-1.amazonaws.com Enter passphrase for key ‘/data/id_deploy’:

This is the current state of my recipe: https://gist.github.com/2423774

This is the current state of my data bag(deploy_key/repository removed): https://gist.github.com/2423781

more →
0 240  
0
Using Chef to backup Windows Servers configs - AD,DNS,IIS,DHCP, Exchange the lot

I have been looking at Chef as a tool for backing up config my windows servers. But from what I can see this is geared more towards *nix doesnt look like there are many scripts for backing windwos configurations up for change management.

Has anybody got any experience using this in a windows environment? Or does anybody know of any other tools that can be used for windows.

Thanks Bill

more →
0 159  
0
How to define before_symlink callback using application cookbook?

I am developing a cookbook to deploy simple jekyll based blog. I use ‘application’ cookbook as a base. Everything works smoothly except chef simply ignore my defined callbacks.

Chef log contains entries about my callback, but I see no errors or outcomes of the callback execution.

Here is recipes/default.rb file:

<!— language: ruby —>

include_recipe "git"

application "xxx_com" do
  path "/var/www/xxx.com"
  repository "git@xxx.org:xxx/xxx.git"
  revision "master"

  deploy_key <<EOF
-----BEGIN RSA PRIVATE KEY-----
..skip...
-----END RSA PRIVATE KEY-----
EOF

  # before_symlink "script/bootstrap"

  before_deploy do
    # raise
    # Chef::Log.info("INSANE!")
    execute "bundle exec rake generate" do
      cwd release_path
    end
  end
end

Here is the log where chef-client says it executes before_deploy callback:

[2012-10-06T10:06:20-04:00] INFO: Processing ruby_block[xxx_com before_deploy] action create (/var/cache/chef/cookbooks/application/providers/default.rb line 107)
[2012-10-06T10:06:20-04:00] DEBUG: Got callback before_deploy: #<Proc:0x00007f0509788088@/var/cache/chef/cookbooks/xxx_com/recipes/default.rb:24>
[2012-10-06T10:06:20-04:00] INFO: application[xxx_com] running callback before_deploy
[2012-10-06T10:06:20-04:00] INFO: ruby_block[xxx_com before_deploy] called
[2012-10-06T10:06:20-04:00] INFO: Processing deploy_revision[xxx_com] action deploy (/var/cache/chef/cookbooks/application/providers/default.rb line 122)

I also try to define callback using string, but the result is the same. Chef shows error when there is no file with callback definition and simply ignores the file if it is the right place.

Update 1

After digging deeper inside Chef sources I realized that callbacks are executed in separate chef runner and this happens not instantly. When code in application cookbook calls recipe_eval to evaluate callback body Chef creates separate runner and the code does not executed until something call converge method.

So, I modified application cookbook a bit. I added call converge just after recipe_eval and everything starts works.

I think this is a bug and I am going to create an issue in official Opscode tracker. However, any comments are very welcome!

Here is modifed version of application/libraries/default.rb:

<!— language: ruby —>

class Chef
  class Provider
    module ApplicationBase

    # ...skip...

      def callback(what, callback_code=nil)
        Chef::Log.debug("Got callback #{what}: #{callback_code.inspect}")
        @collection = Chef::ResourceCollection.new
        case callback_code
        when Proc
          Chef::Log.info "#{@new_resource} running callback #{what}"
          # recipe_eval(&callback_code)
          recipe_eval(&callback_code)
          converge # <--- Remove this line and no callbacks will work.
        when String
          callback_file = "#{release_path}/#{callback_code}"
          unless ::File.exist?(callback_file)
            raise RuntimeError, "Can't find your callback file #{callback_file}"
          end
          run_callback_from_file(callback_file)
        when nil
          nil
        else
          raise RuntimeError, "You gave me a callback I don't know what to do with: #{callback_code.inspect}"
        end
      end
    end
  end
end
more →
1 168  
0
Unable to upload cookbook the second time

I am running chef from a grid cloud image. Everything works fine the first time I try to upload a cookbook, recipes and then run chef-client. But if I edit some recipe and then try to upload the cookbook again I get the following error:

Uploading graphite                       [1.0.5]
ERROR: Failed to upload #<Chef::CookbookVersion:0x00000001c7a398> : 500 Internal Server Error
{"error":["No such file or directory - /usr/local/rvm/gems/ruby-1.9.3-p125/gems/chef-server-api-0.10.8.3/sandbox20121009-2118-s36xlp.lock"]}
ERROR: RestClient::InternalServerError: 500 Internal Server Error
ERROR: Failed to upload #<Chef::CookbookVersion:0x00000001c7a398> : 500 Internal Server Error
{"error":["No such file or directory - /usr/local/rvm/gems/ruby-1.9.3-p125/gems/chef-server-api-0.10.8.3/sandbox20121009-2118-tzcuve.lock"]}root@chef-server:/root

Not able to figure this out.

more →
0 121