Chef-rundeck install

1,579 views
Skip to first unread message

Cindia

unread,
Feb 20, 2012, 8:30:17 AM2/20/12
to rundeck-discuss
Could anyone share some reference or experience how to install and
guidline to try through the functions of rundeck as chef wraper.
Should I install rundeck server firstly with chef server together?
Thanks in advance

Anthony Shortland

unread,
Feb 20, 2012, 11:50:49 AM2/20/12
to rundeck...@googlegroups.com
Not sure it its completely clean and accurate, but have you see http://kb.dtosolutions.com/wiki/Main_Page/chef-rundeck ? Works off of: https://github.com/opscode/chef-rundeck

We really should post a write-up of reconciling Rundeck directed orchestration of the Chef client run against its default convergent orchestration setup, but I believe we're still looking for the definitive mechanism to conveniently suspend the chef client's timed execution.

Anthony.

xinhui li

unread,
Feb 21, 2012, 1:48:31 AM2/21/12
to rundeck...@googlegroups.com
Yes, I followed the mentioned guidance installed chef, rundeckserver, and chef-rundeck on my laptop and registred sucessfully my laptop as a client of opscode hosted chef server.  After running the command "sudo -b chef-rundeck -c /etc/chef/client.rb -u rundeck  -w https://manage.opscode.com/" Got below prompt message:

root@ubuntu:~/Downloads# == Sinatra/1.3.2 has taken the stage on 9980 for development with backup from Thin
>> Thin web server (v1.2.4 codename Flaming Astroboy)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:9980, CTRL+C to stop

I am new to this, wonder what next steps to test function of chef-rundeck? How can I use this/rundeck webui to get the execution status of laptop chef client? Thanks.



2012/2/21 Anthony Shortland <anthony....@me.com>



--
yours sincerely, xin hui
      |\      _,,,---,,_
ZZZzz /,`.-'`'    -.  ;-;;,_
     |,4-  ) )-,_. ,\ (  `'-'
    '---''(_/--'  `-'\_) fL

Anthony Shortland

unread,
Feb 21, 2012, 11:08:43 AM2/21/12
to rundeck...@googlegroups.com
A good check to confirm that the Chef node provider is working is to navigate directly to the Sinatra web server:  http://localhost:9980 or similar.

After that, assuming you've followed the steps to update your Rundeck project's "project.properties" file to use the resources URL, you should be able to go to Rundeck run page see the set of nodes provided by Chef.

As for getting "the execution status of laptop chef client" ... the intent of the chef-rundeck node provider is to allow Rundeck to see the set of nodes that Chef is managing as a general basis for running commands and jobs ... one such job can be using Rundeck to execute the Chef client (normally or in solo mode as required).

Note that you'll need to setup ssh access from the Rundeck server to the client nodes to support "dispatching" commands (see http://rundeck.org/docs/administration/ssh.html).

Anthony,

xinhui li

unread,
Feb 21, 2012, 8:00:23 PM2/21/12
to rundeck...@googlegroups.com
Got the error of no client name when access localhost:9980. I can run chef-client on the local side. Seems can not talk with opscode server by rest... should the client name be gotten from env? like hostname. or somewhere I should set manually? My client.rb and error log is attached below:

log_level        :info
log_location     STDOUT
chef_server_url  "https://api.opscode.com/organizations/vc2"
validation_key           "/root/chef-repo-in/.chef/vc2-validator.pem"
validation_client_name "chef-validator"


root@ubuntu:~/Downloads# ArgumentError - Cannot sign the request without a client name, check that :node_name is assigned:
    /usr/lib/ruby/gems/1.8/gems/chef-0.10.6/lib/chef/rest/auth_credentials.rb:41:in `signature_headers'
    /usr/lib/ruby/gems/1.8/gems/chef-0.10.6/lib/chef/rest.rb:329:in `authentication_headers'
    /usr/lib/ruby/gems/1.8/gems/chef-0.10.6/lib/chef/rest.rb:374:in `build_headers'
    /usr/lib/ruby/gems/1.8/gems/chef-0.10.6/lib/chef/rest.rb:224:in `api_request'
    /usr/lib/ruby/gems/1.8/gems/chef-0.10.6/lib/chef/rest.rb:114:in `get_rest'
    /usr/lib/ruby/gems/1.8/gems/chef-0.10.6/lib/chef/search/query.rb:42:in `search'
    /usr/lib/ruby/gems/1.8/gems/chef-0.10.6/lib/chef/node.rb:564:in `list'
    /usr/lib/ruby/gems/1.8/gems/chef-rundeck-0.2.0/lib/chef-rundeck.rb:40:in `GET /'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:1211:in `call'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:1211:in `compile!'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:785:in `[]'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:785:in `route!'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:801:in `route_eval'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:785:in `route!'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:822:in `process_route'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:820:in `catch'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:820:in `process_route'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:784:in `route!'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:783:in `each'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:783:in `route!'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:886:in `dispatch!'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:719:in `call!'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:871:in `invoke'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:871:in `catch'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:871:in `invoke'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:719:in `call!'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:705:in `call'
    /usr/lib/ruby/gems/1.8/gems/rack-protection-1.2.0/lib/rack/protection/xss_header.rb:22:in `call'
    /usr/lib/ruby/gems/1.8/gems/rack-protection-1.2.0/lib/rack/protection/path_traversal.rb:16:in `call'
    /usr/lib/ruby/gems/1.8/gems/rack-protection-1.2.0/lib/rack/protection/json_csrf.rb:17:in `call'
    /usr/lib/ruby/gems/1.8/gems/rack-protection-1.2.0/lib/rack/protection/base.rb:47:in `call'
    /usr/lib/ruby/gems/1.8/gems/rack-protection-1.2.0/lib/rack/protection/xss_header.rb:22:in `call'
    /usr/lib/ruby/gems/1.8/gems/rack-1.4.0/lib/rack/nulllogger.rb:9:in `call'
    /usr/lib/ruby/gems/1.8/gems/rack-1.4.0/lib/rack/head.rb:9:in `call'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/showexceptions.rb:21:in `call'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:1334:in `call'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:1416:in `synchronize'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:1334:in `call'
    /usr/lib/ruby/1.8/thin/connection.rb:76:in `pre_process'
    /usr/lib/ruby/1.8/thin/connection.rb:74:in `catch'
    /usr/lib/ruby/1.8/thin/connection.rb:74:in `pre_process'
    /usr/lib/ruby/1.8/eventmachine.rb:1060:in `call'
    /usr/lib/ruby/1.8/eventmachine.rb:1060:in `spawn_threadpool'
    /usr/lib/ruby/1.8/eventmachine.rb:1057:in `initialize'
    /usr/lib/ruby/1.8/eventmachine.rb:1057:in `new'
    /usr/lib/ruby/1.8/eventmachine.rb:1057:in `spawn_threadpool'
    /usr/lib/ruby/1.8/eventmachine.rb:1049:in `defer'
    /usr/lib/ruby/1.8/thin/connection.rb:54:in `process'
    /usr/lib/ruby/1.8/thin/connection.rb:42:in `receive_data'
    /usr/lib/ruby/1.8/eventmachine.rb:257:in `run_machine'
    /usr/lib/ruby/1.8/eventmachine.rb:257:in `run'
    /usr/lib/ruby/1.8/thin/backends/base.rb:57:in `start'
    /usr/lib/ruby/1.8/thin/server.rb:156:in `start'
    /usr/lib/ruby/gems/1.8/gems/rack-1.4.0/lib/rack/handler/thin.rb:13:in `run'
    /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:1295:in `run!'
    /usr/lib/ruby/gems/1.8/gems/chef-rundeck-0.2.0/bin/chef-rundeck:59
    /usr/bin/chef-rundeck:19:in `load'
    /usr/bin/chef-rundeck:19


2012/2/22 Anthony Shortland <anthony....@me.com>

Moses Lei

unread,
Feb 22, 2012, 2:32:25 PM2/22/12
to rundeck...@googlegroups.com
One way to fix this is by specifying the node name of the server in /etc/chef/client.rb and using the webui.pem key or whatever existing admin key you have:

node_name                'name_of_chef_server'
client_key               '/etc/chef/webui.pem'

But a better way to do it would be to configure knife on your local non-root user account (using knife configure -i [1]), and then use that as the config file to use for chef-rundeck. This way you can run it as non-root and not sharing the API key of the web UI. Then you'd run chef-rundeck like this, as your local knife user:

chef-rundeck -c ~/.chef/knife.rb -u deploy -w http://mychefserver:4040

Moses

--
Moses Lei
[ Professional Services | DTO Solutions, Inc. ]
[ mobile: +1 703.901.5969 | e-mail: ml...@dtosolutions.com | aim/gtalk: ml...@controltier.com | yahoo: moseslei | windows live (msn): ml...@dtosolutions.com ]

xinhui li

unread,
Feb 23, 2012, 12:29:44 AM2/23/12
to rundeck...@googlegroups.com
Thanks a lot, I add node_name into the client.rb then it works, show the node list when access localhost:9980. Then I loginto rundeck run page with admin to . I input a filter "*" but got the promote exception as below:
com.dtolabs.rundeck.core.resources.format.ResourceFormatParserException: com.dtolabs.rundeck.core.common.NodeFileParserException: com.dtolabs.shared.resources.ResourceXMLParserException: org.dom4j.DocumentException: Error on line -1 of document : Premature end of file. Nested exception: Premature end of file. Error requesting URL Resource Model Source: http://localhost:9980: Unable to get and write file: /var/rundeck/projects/chef-demo/var/urlResourceModelSourceCache/d31e7aaa29a8d84cb5a61800738d5b6c24811715.temp.lock (No such file or directory)

Thanks.

2012/2/23 Moses Lei <ml...@dtosolutions.com>

Moses Lei

unread,
Feb 23, 2012, 1:47:38 AM2/23/12
to rundeck...@googlegroups.com
This sounds like an issue with the RunDeck server permissions. What OS and version is running RunDeck and how was it installed?

The other thing to check is whether it works to run "curl http://chefserver:9980" or "wget -O - http://chefserver:9980" from the RunDeck box. Is it the same machine for both RunDeck and chef?

Moses

--
Moses Lei
[ Professional Services | DTO Solutions, Inc. ]
[ mobile: +1 703.901.5969 | e-mail: ml...@dtosolutions.com | aim/gtalk: ml...@controltier.com | yahoo: moseslei | windows live (msn): ml...@dtosolutions.com ]



xinhui li

unread,
Feb 23, 2012, 4:43:00 AM2/23/12
to rundeck...@googlegroups.com
Yes, I run chef client and rundeck server together on my ubuntu 11.04 laptop, use opscode hosted chef server (its webui is https://manage.opscode.com/). I installed it from rpm and also download the java launcher.

By your reminder, I restarted rundeck launcher then "curl http://localhost:9980" got the right response. I expect that it should collect all the nodes into rundeck box and I can search any one by filter. But now I just can find only one node of my laptop. Anything I mist? such as running some command on rundeck run page or something others?

2012/2/23 Moses Lei <ml...@dtosolutions.com>

Anthony Shortland

unread,
Aug 7, 2012, 11:52:53 AM8/7/12
to rundeck...@googlegroups.com, Vinay B R
Sorry to say that the KB site is unavailable.

Where are you stuck, exactly? I'm sure we can get you going ... 

Anthony.

On Aug 7, 2012, at 2:12 AM, Vinay B R <vinayb...@gmail.com> wrote:

Hi Anthony

Link http://kb.dtosolutions.com/wiki/Main_Page/chef-rundeck is broken.  Could you please provide me a working link as i am stuck here to proceed further on how to integrate rundeck server and chef.

Looking forward to hearing from you soon.

Thanking you in advance.

Regards
Vinay
Reply all
Reply to author
Forward
0 new messages