popularity question answers views user  
0
Fetching attributes recipes and roles of a cookbook

I am trying to fetch all the attributes,recipes roles of a cookbook,
That are given in metadata.rb files.
question is.. is it mandatory to have a metadata.rb file or what is the prirority that should be given if metadata.rb dont exist, go to attributes, recipes folder and fetch them from there?

more →
0 40  
0
Thrift cookbook refers to an outdated version and path of thrift

The thrift cookbook defaults to 0.6.0, and to the tds.net apache mirror. In the apache master and mirrors 0.6.0 and 0.6.1 are no longer on the servers. Those versions are distributed via archive.apache.org. On archive.apache.org the path to the thrift director is different.

I needed to do this:

origin_path = "thrift" if node['thrift']['mirror'] == "archive.apache.org" origin_path = "dist/thrift" end remote_file "#{Chef::Config[:file_cache_path]}/thrift-#{version}.tar.gz" do source "http://#{node['thrift']['mirror']}/#{origin_path}/#{version}/thrift-#{version}.tar.gz" checksum node['thrift']['checksum'] end

  • edit: Also, the preview of the above markdown pre-formatted block looks OK, but the resulting text doesn’t look so good.
more →
0 190  
0
Chef client 11.4.0 error

Hi. Recently installed Chef 11.0.4 and i’m trying to get role listing with command ‘knife role list’. Sometimes it works bur sometimes i get error

$ knife -v Chef: 11.4.0

$ chef-client -v Chef: 11.4.0

$ knife role list /var/lib/gems/1.8/gems/chef-11.4.0/lib/chef/knife/cookbook_upload.rb:25: superclass mismatch for class CookbookUpload (TypeError)

from /var/lib/gems/1.8/gems/chef-11.4.0/lib/chef/knife/core/subcommand_loader.rb:37:in `load'
from /var/lib/gems/1.8/gems/chef-11.4.0/lib/chef/knife/core/subcommand_loader.rb:37:in `load_commands'
from /var/lib/gems/1.8/gems/chef-11.4.0/lib/chef/knife/core/subcommand_loader.rb:37:in `each'
from /var/lib/gems/1.8/gems/chef-11.4.0/lib/chef/knife/core/subcommand_loader.rb:37:in `load_commands'
from /var/lib/gems/1.8/gems/chef-11.4.0/lib/chef/knife.rb:119:in `load_commands'
from /var/lib/gems/1.8/gems/chef-11.4.0/lib/chef/knife.rb:167:in `run'
from /var/lib/gems/1.8/gems/chef-11.4.0/lib/chef/application/knife.rb:123:in `run'
from /var/lib/gems/1.8/gems/chef-11.4.0/bin/knife:25
from /usr/local/bin/knife:19:in `load'
from /usr/local/bin/knife:19

I have no idea what that means. Need help. Thanks.

Regards, marek

more →
0 58  
0
TypeError - can't convert nil into String

I am on Ubuntu 11.04 running chef 0.10.8. While trying to install vmware’s cloud-foundry using chef cookbooks, one particular cookbook whose link is shown below, makes chef to throw the exception TypeError – can’t convert nil into String :

https://github.com/cloudfoundry/vcap/blob/master/dev_setup/cookbooks/ccdb/attributes/default.rb

The full stack trace of the exception is shown below. Please how do i resolve, TypeError – can’t convert nil into String.

Re-raising exception: TypeError – can’t convert nil into String /home/dav29/cloudfoundry/vcap/dev_setup/cookbooks/ccdb/attributes/default.rb:6:in `join'

The abridged stacktrace is below. pls how can i resolve this.

$ bin/vcap_dev_setup Checking web connectivity. /home/dav29/.rbenv/shims/chef-solo

Reading package lists… Done Reading package lists… Building dependency tree… Reading state information… Cloning into ‘vcap’… remote: Counting objects: 5651, done. Resolving deltas: 100% (3017/3017), done. Submodule ‘java’ (https://github.com/cloudfoundry/vcap-java.git) registered for path ‘java’ Submodule ‘services’ (https://github.com/cloudfoundry/vcap-services.git) registered for path ‘services’ Submodule ‘tests’ (https://github.com/cloudfoundry/vcap-tests.git) registered for path ‘tests’ remote: Counting objects: 1496, done. remote: Compressing objects: 100% (643/643), done. Cloning into ‘tests’…

Installing deployment devbox, cloudfoundry home dir is /home/dav29/cloudfoundry [Tue, 10 Jan 2012 15:55:11 +0000] INFO: Chef 0.10.8 [Tue, 10 Jan 2012 15:55:24 +0000] DEBUG: Platform is ubuntu version 11.04

[Tue, 10 Jan 2012 15:55:24 +0000] INFO: Run List expands to [deployment, essentials, ruby, nats_server, cloudfoundry, nginx, router, postgresql, ccdb, ruby::ruby18, cloud_controller, health_manager, dea, redis, redis::node, mysql, mysql::node, mongodb, mongodb::node, neo4j, neo4j::node, redis::gateway, mysql::gateway, mongodb::gateway, neo4j::gateway]

[Tue, 10 Jan 2012 15:55:24 +0000] DEBUG: No chefignore file found at /home/dav29/cloudfoundry/vcap/dev_setup/cookbooks/chefignore no files will be ignored [Tue, 10 Jan 2012 15:55:25 +0000] DEBUG: Loading cookbook cloudfoundry’s library file: /home/dav29/cloudfoundry/vcap/dev_setup/cookbooks/cloudfoundry/libraries/cloudfoundry.rb

[Tue, 10 Jan 2012 15:55:25 +0000] DEBUG: Node dav.localdomain loading cookbook ccdb’s attribute file /home/dav29/cloudfoundry/vcap/dev_setup/cookbooks/ccdb/attributes/default.rb [Tue, 10 Jan 2012 15:55:25 +0000] ERROR: Running exception handlers [Tue, 10 Jan 2012 15:55:25 +0000] ERROR: Exception handlers complete [Tue, 10 Jan 2012 15:55:25 +0000] DEBUG: Re-raising exception: TypeError – can’t convert nil into String /home/dav29/cloudfoundry/vcap/dev_setup/cookbooks/ccdb/attributes/default.rb:6:in join' /home/dav29/cloudfoundry/vcap/dev_setup/cookbooks/ccdb/attributes/default.rb:6:infrom_file' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/mixin/from_file.rb:30:in instance_eval' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/mixin/from_file.rb:30:infrom_file' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/node.rb:655:in block (2 levels) in load_attributes' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/node.rb:653:ineach' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/node.rb:653:in block in load_attributes' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/node.rb:652:ineach' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/node.rb:652:in load_attributes' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/run_context.rb:101:inload_attributes' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/run_context.rb:60:in load' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/client.rb:195:insetup_run_context' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/client.rb:159:in run' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/application/solo.rb:192:inblock in run_application' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/application/solo.rb:183:in loop' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/application/solo.rb:183:inrun_application' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/application.rb:67:in run' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/bin/chef-solo:25:in<top (required)>‘ /usr/bin/chef-solo:19:in load' /usr/bin/chef-solo:19:in<main>’ [Tue, 10 Jan 2012 15:55:26 +0000] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out [Tue, 10 Jan 2012 15:55:26 +0000] DEBUG: TypeError: can’t convert nil into String /home/dav29/cloudfoundry/vcap/dev_setup/cookbooks/ccdb/attributes/default.rb:6:in join' /home/dav29/cloudfoundry/vcap/dev_setup/cookbooks/ccdb/attributes/default.rb:6:infrom_file' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/mixin/from_file.rb:30:in instance_eval' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/mixin/from_file.rb:30:infrom_file' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/node.rb:655:in block (2 levels) in load_attributes' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/node.rb:653:ineach' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/node.rb:653:in block in load_attributes' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/node.rb:652:ineach' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/node.rb:652:in load_attributes' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/run_context.rb:101:inload_attributes' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/run_context.rb:60:in load' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/client.rb:195:insetup_run_context' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/client.rb:159:in run' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/application/solo.rb:192:inblock in run_application' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/application/solo.rb:183:in loop' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/application/solo.rb:183:inrun_application' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/application.rb:67:in run' /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.8/bin/chef-solo:25:in<top (required)>‘ /usr/bin/chef-solo:19:in load' /usr/bin/chef-solo:19:in<main>’ [Tue, 10 Jan 2012 15:55:26 +0000] FATAL: TypeError: can’t convert nil into String

more →
1 271  
0
Include recipes on definitions

Hi guys,

I’m new on chef and have spent some days reading documentation. And saw some examples where on a Definition there is an include_recipe “somename” sentence.

On the doc, cant uderstand 100% the Definitions and utility, can someone bring me some light on this?

Thanks!

more →
0 26
8la
 
0
Can't Bootstrap CentOS 5.4 ???

I am a noob….

I have been able to successfully bootstrap (add node) for both ubuntu 10.04 & oel5.4, but have had trouble with CentOS 5.4

For ubuntu I used: knife bootstrap <IP> -u <user> -P <password> —sudo

For oel: knife bootstrap <IP> -u root -P <password> -d centos5-gems

I tried the oel command on centos but I get an error:

centos1 /usr/lib/ruby/1.8/openssl/cipher.rb:22 centos1 : centos1 Cipher is not a module centos1 ( centos1 TypeError centos1 ) centos1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require' centos1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:inrequire' centos1 from /usr/lib/ruby/1.8/openssl.rb:20 centos1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require' centos1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:inrequire' centos1 from /usr/lib/ruby/1.8/net/https.rb:102 centos1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require' centos1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:inrequire' centos1 from /usr/lib64/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/rest.rb:23 centos1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require' centos1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:inrequire' centos1 from /usr/lib64/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/search/query.rb:21 centos1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require' centos1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:inrequire' centos1 from /usr/lib64/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/mixin/language.rb:19 centos1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require' centos1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:inrequire' centos1 from /usr/lib64/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/resource.rb:22 centos1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require' centos1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:inrequire' centos1 from /usr/lib64/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/resource/file.rb:19 centos1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require' centos1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:inrequire' centos1 from /usr/lib64/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/provider/file.rb:21 centos1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require' centos1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:inrequire' centos1 from /usr/lib64/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/provider/cookbook_file.rb:20 centos1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require' centos1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:inrequire' centos1 from /usr/lib64/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/providers.rb:20 centos1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require' centos1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:inrequire' centos1 from /usr/lib64/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef.rb:25 centos1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require' centos1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:inrequire' centos1 from /usr/lib64/ruby/gems/1.8/gems/chef-0.10.8/bin/chef-client:23 centos1 from /usr/bin/chef-client:19:in `load' centos1 from /usr/bin/chef-client:19

more →
0 201  
0
Cannot find a resource for runit_service on ubuntu version 12.04

I’m trying to install nginx on an amazon ec2 instance but I’m receiving an “Cannot find a resource for runit_service on ubuntu version 12.04” error.

What’s strange is that I am able to configure nginx in a virtual machine node managed by vagrant (running $ vagrant provision node_name).

My run list:

“run_list”: [

"recipe[runit]",
"recipe[nginx::source]" ]

Nginx configuration:

“nginx”: {

"install_method": "source",
"default_site_enabled": "false",
"user" : "www-data",
"source": {
  "modules": ["http_gzip_static_module","http_ssl_module"]
},
"version": "1.3.15"   }

I’m running

chef-solo -c /tmp/chef-solo/solo.rb -j /tmp/chef-solo/nodes/node.json

from the terminal.

This is the error stack trace: https://gist.github.com/anonymous/8fe2dfe655ce0a3d51e0

I’ll appreciate any thoughts.

Thanks.

more →
0 83  
0
How to manage client configuration for multiple organizations

When using hosted chef with multiple organizations (where organization is the right way to differentiate projects as opposed to setting environments) what is the best approach for managing the client configuration files?

I have separate organizations, each with their own validation key, and generated knife.rb configuration. On my workstations I have separate chef repos and chef client configuration directories for each organization.

But, how do I best manage /etc/chef/*?

I was thinking that I could create separate /etc/chef_ORGANIZATION directories to hold the appropriate configuration and validations, then just symlink /etc/chef to the org I’m working with.

Anyone have other suggestions on how to work with multiple orgs?

more →
0 379  
0
Overriding variables twice

I’m having an issue where I run the following opscode cookbooks but I’m overriding the java “install_flavor” to use “oracle”.

{
    "run_list": [ "recipe[apt::default]",
        "recipe[java]",
        "recipe[tomcat]" ],
}

The initial java recipe installs oracle version of java however, tomcat also includes java which for some reason runs and installs and openjdk regardless of the following override.

"override_attributes": {
    "java": {
        "install_flavor": "oracle",
        "oracle" : {
            "accept_oracle_download_terms" : true
        }
    }
}

Am I doing something wrong?

Thanks for your help, Joe

more →
0 34  
0
redisio client recipe - role search

Hey there, I’m using a community recipe with the name redisio and it actually works very well.
Problem is I’m new to this stuff and I don’t understand everything in this Cookbook.

I want to integrate a client recipe in the cookbook. This client recipe should search for a role named redismaster an use the IP address (or put it into a variable named @master_redis) for the redis-config file of the client. –> Usually not a big deal but I don’t know how to handle it here

PS I prepared something and I think I can use this lines in the template erb file

<% @master_redis.each do |system| –%>

address <%= system['ipaddress'] %> 6379

<% end –%>

more →
1 44