popularity question answers views user  
0
How to pass attributes from knife command via ssh?

I am wondering if it is possible to pass attributes from knife command (via ssh), e.g. https://github.com/opscode/cookbooks/tree/master/java, I want to pass the node['java']['jdk'] via the command line below. Possible?

knife ssh ‘role:app-server’ ‘sudo chef-client’

more →
0 80  
0
Chef Server Support for Ubuntu 12.04 Precise

I apologize in advance. The documentation does not include Ubuntu 12.04 precise as a supported platform.

Will Chef Server work on Ubuntu 12.04?

If so, which installation types.

thanks

JD

more →
0 97  
0
install Chef Server failed

Hi

I try to install a Chef server following the manual guide, My box is RHEL5

but got the following errors

Gem files will remain installed in /usr/lib64/ruby/gems/1.8/gems/dep_selector-0.0.8 for inspection.
Results logged to /usr/lib64/ruby/gems/1.8/gems/dep_selector-0.0.8/ext/dep_gecode/gem_make.out
Building native extensions.  This could take a while...
ERROR:  Error installing chef-server-api:
        ERROR: Failed to build gem native extension.

        /usr/bin/ruby extconf.rb
checking for main() in -lgecodesearch... no
=========================================================================================
Gecode >3.5 must be installed (http://www.gecode.org/).

OSX:
  brew install gecode

I had installed gecode-3.5.0 don’t know why it still said there is no gecode installed.

Pls let me know what’s wrong.

Thanks Rosso

more →
0 104  
0
How to call a shell script in a recipe

I have a block like this :

file “/templates/s3download.sh” do owner “root” mode “0755” content <<-EOH sudo -sh EOH end

execute “/templates/default/s3download.sh”

Here is my error:

In /var/chef/cache/cookbooks/wpplugthemes/recipes/default.rb

15: file “/templates/default/s3download.sh” do 16: owner “root” 17: mode “0755” 18: content <<-EOH 19: sudo -sh 20: EOH 21: end 22:

Compiled Resource:

Declared in /var/chef/cache/cookbooks/wpplugthemes/recipes/default.rb:15:in `from_file'

file(“/templates/default/s3download.sh”) do provider Chef::Provider::File action “create” retries 0 retry_delay 2 path “/templates/default/s3download.sh” backup 5 cookbook_name “wpplugthemes” recipe_name “default” owner “root” mode “0755” content “ sudo -sh\n” end

[2013-01-30T06:44:04+00:00] ERROR: Running exception handlers [2013-01-30T06:44:04+00:00] FATAL: Saving node information to /var/chef/cache/failed-run-data.json [2013-01-30T06:44:04+00:00] ERROR: Exception handlers complete [2013-01-30T06:44:04+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out [2013-01-30T06:44:04+00:00] FATAL: Chef::Exceptions::EnclosingDirectoryDoesNotExist: file[/templates/default/s3download.sh] (wpplugthemes::default line 15) had an error: Chef::Exceptions::EnclosingDirectoryDoesNotExist: Parent directory /templates/default does not exist.

I have put my file in the recipe nameofcookbook/templates/default/s3download.sh

I am new to chef so please help.

more →
1 88  
0
FATAL: Net::HTTPBadResponse: wrong status line: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">""

Hi,

I have configured my chef server to be serve on https. I have a SSL cert configured and working on browser serving https on the domain (e.g.) https://chef.mydomain.com:4001

when i do chef client on it im having an error like this.


chef-client

[2013-02-04T08:32:01+00:00] INFO: Chef 10.18.2 [2013-02-04T08:32:02+00:00] WARN: unable to detect ip6address [2013-02-04T08:32:03+00:00] INFO: Run List is [role[Wordpress]] [2013-02-04T08:32:03+00:00] INFO: Run List expands to [mysql::server, mysql::client, mysql::ruby, apache2, php, wordpress, wpplugthemes] [2013-02-04T08:32:03+00:00] INFO: HTTP Request Returned 404 Not Found: No routes match the request: /reports/nodes/my_machine/runs [2013-02-04T08:32:03+00:00] INFO: Starting Chef Run for ip-10-136-122-13.ap-southeast-1.compute.internal [2013-02-04T08:32:03+00:00] INFO: Running start handlers [2013-02-04T08:32:03+00:00] INFO: Start handlers complete. [2013-02-04T08:32:04+00:00] INFO: Loading cookbooks [apache2, build-essential, mysql, openssl, php, wordpress, wpplugthemes, xml]

================================================================================

Error Syncing Cookbooks:

Unexpected Error:

Net::HTTPBadResponse: wrong status line: “<!DOCTYPE HTML PUBLIC \”–//IETF//DTD HTML 2.0//EN\“>”

[2013-02-04T08:32:04+00:00] ERROR: Running exception handlers [2013-02-04T08:32:04+00:00] FATAL: Saving node information to /var/chef/cache/failed-run-data.json [2013-02-04T08:32:04+00:00] ERROR: Exception handlers complete [2013-02-04T08:32:04+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out [2013-02-04T08:32:04+00:00] FATAL: Net::HTTPBadResponse: wrong status line: “<!DOCTYPE HTML PUBLIC \”–//IETF//DTD HTML 2.0//EN\“>”


any help would be appreciated

  • chris
more →
0 153  
0
knife bootstrap failing to register a node : HTTP 403

I am using chef 11 (server and client).

When I am trying to bootstrap a node using knife or just try to start the chef client I am getting the HTTP 403 error saying

Your validation client is not authorized to create the client for this node (HTTP 403). * There may already be a client named “test” * Your validation client (chef-validator) may have misconfigured authorization permissions.

by trying to run the chef-client in debug mode I observerd that when it tries to send a GET requext to the chef-server in port 443 to retrieve the clients the request fails and throws the HTTP 403 error.

Any clue about the root cause and the fix?

more →
1 136  
0
Cannot Find Node Attribute

I am trying to install Munin through hosted Chef on a Vagrant VM. When installing the Munin Client, it performs a search for the Munin Servers.

munin_servers = search(:node, "role:#{node['munin']['server_role']} AND chef_environment:#{node.chef_environment}")

However, this search is failing, with a 400 “Bad Request”. I did a quick check, and node[‘munin’][‘server_role’] is nil.

But how can that be? It defines what it is in the Cookbooks attribute file. It sets it to “Monitoring”. I wanted to change that, so in the my Role I have:

{
  "name": "munin-node",
  "description": "",
  "json_class": "Chef::Role",
  "default_attributes": {
    "munin": {
      "server_role": "munin-server"
    }
  },
  "override_attributes": {
  },
  "chef_type": "role",
  "run_list": [
    "recipe[munin::client]"
  ],
  "env_run_lists": {
  }
}

I define node[‘munin’][‘server_role’] in that file. In fact, I went as far as to print out the entire node object:

node.each do |k, v|
  puts "Key: #{k} and V: #{v}"
end

And it shows:

Key: munin and V: {"sysadmin_email"=>"ethan@cloudmine.me", "server_role"=>"munin-server", "server_auth_method"=>"htpasswd", "web_server"=>"apache", "web_server_port"=>8080, "basedir"=>"/etc/munin", "plugin_dir"=>"/usr/share/munin/plugins", "docroot"=>"/var/www/munin", "dbdir"=>"/var/lib/munin", "root"=>{"group"=>"root"}, "plugins"=>"/etc/munin/plugins", "tmpldir"=>"/etc/munin/templates", "max_graph_jobs"=>"6", "max_cgi_graph_jobs"=>"6", "max_processes"=>nil}

I see it! I see my server_role has been defined! It’s right here! So why is it nil when I access it? What is happening?

Chef Workstation Version: 10.24.0 Chef-Client Version: 10.24.0 Ruby Version: 1.9.3

more →
0 68  
0
can't run chef-client::service recipe on chef 11 server

if I add the chef-client::service (or even the chef-client::cron) recipe to a chef-11 server, the chef-client run will fail.

The error is that it can’t find a user named ‘chef’ when it tries to set ownership on the /var/run/chef directory.

Is this an incompatibility with this recipe and new chef 11 server?

more →
0 31  
0
How to bootstrap a node without knife?

Hi, i would like to bootstrap a node without using knife (from within the node itself) (on ubuntu 12.04)
I can install ruby and chef-client, no problem. then i put inside /etc/chef the “client.rb” with the server_url, client_key and validation_client_name.
I also put the correct validator file in this directory. Now if i run “chef-client” the node accesses the server and gets configured on the server. however no roles/recipes/etc are run on the node. My question is, how can i give the client a list of recipes/roles to run on the first run? Also, i noticed that a first-boot.json file is generated (i tried using knife to simulate and it generated that file) with my roles/recipes inside, but “chef-client” seems to ignore it. Also, where would i put the attributes for the node?

Thanks in advance

more →
0 28  
0
Errors when installing openstack using chef on Red Hat Enterprise Linux Server release 6.3 (Santiago)

Hi all,

I’m trying to setup openstack folsom using chef on Red Hat Enterprise Linux Server release 6.3 (Santiago). On the chef workstation, I have used git to download the openstack-chef-repo ( git clone https://github.com/mattray/openstack-chef-repo.git), used librarian to do some configuration. After uploading the cookbooks, updating the env production, and updating the roles. I used the following command to add the chef client:

knife node run_list add rhcn2.cluster1.com "role[allinone]"

I logged into the rhcn2.cluster1.com, and run “chef-client”, it output some errors. such as :


Recipe: apt::default * execute[apt-get-update] action run[2013-04-14T23:09:19-04:00] ERROR: execute[apt-get-update] (apt::default line 22) had an error: No such file or directory – apt-get update; ignore_failure is set, continuing

========================================================================

Error executing action run on resource ‘execute[apt-get-update]’

========================================================================

Errno::ENOENT

No such file or directory – apt-get update


It looks like it tried to use apt-get on redhat. I’m not sure if there is something wrong with the setting in my environment. Do you have any ideas about it?

Does chef support openstack folsom on redhat ?

Best Wishes. Thanks.

more →
0 53
jjh