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
knife ssh ‘role:app-server’ ‘sudo chef-client’
install Chef Server failed
I try to install a Chef server following the manual guide, My box is RHEL5
but got the following errors
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.
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
Here is my error:
15: file “/templates/default/s3download.sh” do 16: owner “root” 17: mode “0755” 18: content <<-EOH 19: sudo -sh 20: EOH 21: end 22:
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.
FATAL: Net::HTTPBadResponse: wrong status line: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">""
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.
[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:
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
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?
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.
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:
I define node[‘munin’][‘server_role’] in that file. In fact, I went as far as to print out the entire node object:
And it shows:
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
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?
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)
Thanks in advance
Errors when installing openstack using chef on Red Hat Enterprise Linux Server release 6.3 (Santiago)
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:
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
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.