Giter Club home page Giter Club logo

chef-rundeck's Introduction

chef-rundeck

Gem Version Build Status Dependency Status Code Climate

A simple Sinatra app that presents matching node results of a Chef search formatted as a RunDeck resource list.

Usage

Install the gem and fire up chef-rundeck. Point it at a Chef client config file (a knife config would be ideal) using the -c flag and provide the URI for your Chef server's web UI.

Configuration Notes

chef-rundeck binds to "localhost," which may result in it binding to an IPv6-only address in certain configurations. If this isn't what you want, try starting chef-rundeck with the -o switch, e.g. -o 0.0.0.0.

You can use the -u switch to override the username that is inserted into a project as the remote user that Rundeck should use for execution. The default is the system user that executes chef-rundeck, which may not be what you expect.

chef-rundeck now supports partial search against Enterprise Chef and OSS Chef servers running version 11 or greater!
If your organization has many nodes and you notice slow performance from chef-rundeck, try turning it on with --partial-search true.

chef-rundeck caches the generated resource XML for a project by default for 30 seconds. If this behavior ruins your day, change the number of seconds a document is cached by using the -t switch.

Further configuration details can be found on the [wiki] (https://github.com/oswaldlabs/chef-rundeck/wiki/).

Rundeck Configuration

Ensure each project has the URL Source under Resource Model Source. By default, the sinatra app is on localhost, port 9980 (http://localhost:9980).

Notes on Patches/Pull Requests

We want your cool additional feature. Here's how to give it to us:

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. THIS IS IMPORTANT as it ensures no one else will break your feature accidentally somewhere down the line.
  • If you're adding a feature, please also add documentation.
  • Exception: Please don't change the Rakefile, version or history files!
  • Commit your changes and push them to your GitHub repo. Bonus points for committing your changes to a named topic branch ("awesome_new_feature" > "master")
  • Send us a pull request through the GitHub UI.

Copyright

Original code © 2010 Adam Jacob. Released to the open source community under the Apache license in 2013. See the LICENSE file for details.

chef-rundeck's People

Contributors

adamhjk avatar astratto avatar djdefi avatar giorgio-v avatar josephholsten avatar leftathome avatar pcross616 avatar stevek avatar tadukurow avatar tas50 avatar threetee avatar wjimenez5271 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chef-rundeck's Issues

Binding to ipv6 only

On an AWS EC2-Classic centos 6.4 host that has ipv6 enabled, chef-rundeck binds to just the ipv6 addresses and not ipv4. Disabling ipv6 in the kernel and restarting chef-rundeck resolves the issue.

Username

Username should be optional, such that the integrated RunDeck user configuration can be utilized. The fallback currently seems to be ENV['USER'].

We can feed in property references, but unfortunately it seems there is no way to configure a sane default. I would have expected something like the below to work, but unfortunately it's a no go. Maybe I've got the interpolation syntax messed up? Who knows.
"username": "${option.ssh.user!\"default_user\"}"

Net::HTTPServerException - 401 "Unauthorized

Hi,
I'm trying chef-rundeck for the first time and I get this error.
I launch chef-rundeck with chef-rundeck -k /etc/chef/client.pem -c /etc/chef/client.rb -w https://vmchef

I have tried many different things, like permission changes, different keys and users, even reinstalling chef, ruby and rundeck but I cannot understand what the real problem is.

This is the error I see in the web console: Cannot get nodes from [URLResourceModelSource{URL='http://localhost:9980'}]: Error requesting URL Resource Model Source: http://localhost:9980: com.dtolabs.rundeck.core.common.FileUpdaterException: Unable to retrieve content: result code: 500 Internal Server Error

And this is the log:
Writing to /var/run/chef-rundeck-9980.pid
Puma 1.6.3 starting...

  • Min threads: 0, max threads: 16
  • Environment: development
  • Listening on tcp://localhost:9980
    == Sinatra/1.4.4 has taken the stage on 9980 for development with backup from Puma
    [2014-01-02T16:15:14+00:00] INFO: HTTP Request Returned 401 Unauthorized: error
    Net::HTTPServerException - 401 "Unauthorized":
    /usr/lib64/ruby/1.8/net/http.rb:2105:in error!' /usr/lib64/ruby/gems/1.8/gems/chef-11.8.2/lib/chef/http.rb:140:inrequest'
    /usr/lib64/ruby/gems/1.8/gems/chef-11.8.2/lib/chef/rest.rb:104:in get_rest' /usr/lib64/ruby/gems/1.8/gems/chef-rundeck-1.0.1/lib/chef-rundeck.rb:52:inGET /'
    /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:1592:in call' /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:1592:incompile!'
    /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:957:in []' /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:957:inroute!'
    /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:976:in route_eval' /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:957:inroute!'
    /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:997:in process_route' /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:995:incatch'
    /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:995:in process_route' /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:955:inroute!'
    /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:954:in each' /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:954:inroute!'
    /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:1067:in dispatch!' /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:ininvoke'
    /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in catch' /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:ininvoke'
    /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:1064:in dispatch!' /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:889:incall!'
    /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in invoke' /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:incatch'
    /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in invoke' /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:889:incall!'
    /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:877:in call' /usr/lib64/ruby/gems/1.8/gems/rack-protection-1.5.1/lib/rack/protection/xss_header.rb:18:incall'
    /usr/lib64/ruby/gems/1.8/gems/rack-protection-1.5.1/lib/rack/protection/path_traversal.rb:16:in call' /usr/lib64/ruby/gems/1.8/gems/rack-protection-1.5.1/lib/rack/protection/json_csrf.rb:18:incall'
    /usr/lib64/ruby/gems/1.8/gems/rack-protection-1.5.1/lib/rack/protection/base.rb:50:in call' /usr/lib64/ruby/gems/1.8/gems/rack-protection-1.5.1/lib/rack/protection/frame_options.rb:31:incall'
    /usr/lib64/ruby/gems/1.8/gems/rack-1.4.5/lib/rack/nulllogger.rb:9:in call' /usr/lib64/ruby/gems/1.8/gems/rack-1.4.5/lib/rack/head.rb:9:incall'
    /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/show_exceptions.rb:21:in call' /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:180:incall'
    /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:2004:in call' /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:1469:incall'
    /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:1778:in synchronize' /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:1469:incall'
    /usr/lib64/ruby/gems/1.8/gems/puma-1.6.3/lib/puma/server.rb:412:in handle_request' /usr/lib64/ruby/gems/1.8/gems/puma-1.6.3/lib/puma/server.rb:306:inprocess_client'
    /usr/lib64/ruby/gems/1.8/gems/puma-1.6.3/lib/puma/server.rb:215:in run' /usr/lib64/ruby/gems/1.8/gems/puma-1.6.3/lib/puma/thread_pool.rb:94:incall'
    /usr/lib64/ruby/gems/1.8/gems/puma-1.6.3/lib/puma/thread_pool.rb:94:in spawn_thread' /usr/lib64/ruby/gems/1.8/gems/puma-1.6.3/lib/puma/thread_pool.rb:55:ininitialize'
    /usr/lib64/ruby/gems/1.8/gems/puma-1.6.3/lib/puma/thread_pool.rb:55:in new' /usr/lib64/ruby/gems/1.8/gems/puma-1.6.3/lib/puma/thread_pool.rb:55:inspawn_thread'
    /usr/lib64/ruby/gems/1.8/gems/puma-1.6.3/lib/puma/thread_pool.rb:120:in <<' /usr/lib64/ruby/gems/1.8/gems/puma-1.6.3/lib/puma/thread_pool.rb:112:insynchronize'
    /usr/lib64/ruby/gems/1.8/gems/puma-1.6.3/lib/puma/thread_pool.rb:112:in <<' /usr/lib64/ruby/gems/1.8/gems/puma-1.6.3/lib/puma/server.rb:253:inhandle_servers'
    /usr/lib64/ruby/gems/1.8/gems/puma-1.6.3/lib/puma/server.rb:248:in each' /usr/lib64/ruby/gems/1.8/gems/puma-1.6.3/lib/puma/server.rb:248:inhandle_servers'
    /usr/lib64/ruby/gems/1.8/gems/puma-1.6.3/lib/puma/server.rb:232:in run' /usr/lib64/ruby/gems/1.8/gems/puma-1.6.3/lib/puma/server.rb:232:ininitialize'
    /usr/lib64/ruby/gems/1.8/gems/puma-1.6.3/lib/puma/server.rb:232:in new' /usr/lib64/ruby/gems/1.8/gems/puma-1.6.3/lib/puma/server.rb:232:inrun'
    /usr/lib64/ruby/gems/1.8/gems/puma-1.6.3/lib/rack/handler/puma.rb:39:in run' /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:1488:instart_server'
    /usr/lib64/ruby/gems/1.8/gems/sinatra-1.4.4/lib/sinatra/base.rb:1426:in run!' /usr/lib64/ruby/gems/1.8/gems/chef-rundeck-1.0.1/bin/chef-rundeck:87 /usr/bin/chef-rundeck:19:inload'
    /usr/bin/chef-rundeck:19

Not able to search Chef nodes on old chef server

We are using an older version of chef server (10.10) for our server configuration management. I wanted to test Rundeck as an orchestration tool for our operations pipeline so I installed this chef-rundeck plugin as per instructions. I'm not able to access the sinatra webapp on 9980 port.

In the log it says, it's searching for nodes but nothing shows up in the UI. We have around 200 nodes but I don't think that can be an issue.

Here's the gist with all logs: https://gist.github.com/bhalothia/7068bd4a34f0cd96f1e3

When I tried to curl the webapp, it gives me this:

curl: (52) Empty reply from server

Is it a known issue? I tried to look up the threads but couldn't find any relevant match.

Also, this plugin works well with a chef 11 server, which I set up for the POC.

IP address instead of hostname

Hello,
I want to use this plugin but I need the IP address instead of hostname.
Some one already changed the code to do it?

Best regards,
Edgar Colque

License missing from gemspec

RubyGems.org doesn't report a license for your gem. This is because it is not specified in the gemspec of your last release.

via e.g.

spec.license = 'MIT'
# or
spec.licenses = ['MIT', 'GPL-2']

Including a license in your gemspec is an easy way for rubygems.org and other tools to check how your gem is licensed. As you can imagine, scanning your repository for a LICENSE file or parsing the README, and then attempting to identify the license or licenses is much more difficult and more error prone. So, even for projects that already specify a license, including a license in your gemspec is a good practice. See, for example, how rubygems.org uses the gemspec to display the rails gem license.

There is even a License Finder gem to help companies/individuals ensure all gems they use meet their licensing needs. This tool depends on license information being available in the gemspec. This is an important enough issue that even Bundler now generates gems with a default 'MIT' license.

I hope you'll consider specifying a license in your gemspec. If not, please just close the issue with a nice message. In either case, I'll follow up. Thanks for your time!

Appendix:

If you need help choosing a license (sorry, I haven't checked your readme or looked for a license file), GitHub has created a license picker tool. Code without a license specified defaults to 'All rights reserved'-- denying others all rights to use of the code.
Here's a list of the license names I've found and their frequencies

p.s. In case you're wondering how I found you and why I made this issue, it's because I'm collecting stats on gems (I was originally looking for download data) and decided to collect license metadata,too, and make issues for gemspecs not specifying a license as a public service :). See the previous link or my blog post about this project for more information.

Invalid node causes error

Apparently we have at least one invalid node where doing:

<node name="#{xml_escape(node[:fqdn])}" 

Results in an error due to xml_escape being passed nil:

NoMethodError - undefined method `fast_xs' for nil:NilClass:
 /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/lib/chef/mixin/xml_escape.rb:126:in `xml_escape'
 /usr/lib/ruby/gems/1.8/gems/chef-rundeck-0.1.0/lib/chef-rundeck.rb:42:in `GET /'
 /usr/lib/ruby/gems/1.8/gems/chef-rundeck-0.1.0/lib/chef-rundeck.rb:39:in `each'
 /usr/lib/ruby/gems/1.8/gems/chef-rundeck-0.1.0/lib/chef-rundeck.rb:39:in `GET /'

Admittedly, we shouldn't have invalid nodes, but it would be nice if this didn't fail.

Could not generate xml when using supervisord

Hello,

here the problem I encounter when I use supervisord :

[2015-02-11T08:59:36+01:00] ERROR: === could not generate xml for {"name"=>"XXXXXXXXX", "chef_environment"=>"int", "run_list"=>#<Chef::RunList:0x00000002bf58e0 @run_list_items=[#<Chef::RunList::RunListItem:0x00000002be13b8 @Version=nil, @type=:role, @name="base">, #<Chef::RunList::RunListItem:0x00000002be12f0 @Version=nil, @type=:role, @name="load_balancer">]>, "recipes"=>[], "roles"=>["base", "load_balancer"], "fqdn"=>"XXXXXXXXX", "hostname"=>"XXXXXXXXX", "kernel_machine"=>"x86_64", "kernel_os"=>"GNU/Linux", "platform"=>"debian", "platform_version"=>"7.8", "tags"=>[]}: undefined method unpack' for nil:NilClass [2015-02-11T08:59:36+01:00] ERROR: === could not generate xml for {"name"=>"XXXXXXXXX", "chef_environment"=>"int", "run_list"=>#<Chef::RunList:0x00000002be02b0 @run_list_items=[#<Chef::RunList::RunListItem:0x00000002ba4260 @version=nil, @type=:role, @name="base">, #<Chef::RunList::RunListItem:0x00000002ba40d0 @version=nil, @type=:role, @name="tomcat">, #<Chef::RunList::RunListItem:0x00000002ba4328 @version=nil, @type=:role, @name="backend">]>, "recipes"=>[], "roles"=>["base", "tomcat", "backend"], "fqdn"=>"XXXXXXXXX", "hostname"=>"XXXXXXXXX", "kernel_machine"=>"x86_64", "kernel_os"=>"GNU/Linux", "platform"=>"debian", "platform_version"=>"7.8", "tags"=>[]}: undefined methodunpack' for nil:NilClass

I have configured chef-rundeck like this in supervisord :
[program:chef-rundeck-test]
command=/usr/local/rvm/gems/ruby-2.2.0/wrappers/chef-rundeck -c /etc/chef/knife.rb -p 9981 --timeout 80
redirect_stderr=true
stdout_logfile=/var/log/chef-rundeck-int.log

(It works perfectly when I start in in command line...)

Thanks a lot for your help and your great tool.

Rundeck is taking the chef-server username as an login credential for the windows Nodes.

I have integrated Rundeck with the chef-server using chef-rundeck ruby gem and using sinatra I was able to load all the nodes information into rundeck from chef-server. But while executing the jobs Rundeck was authenticating with the nodes using chef-server's username. How can I over ride the username using plugin configuration? As shown in the attachment 'ckatraga' was my chef server login username. Can anyone please help me with this.
Plugin I was using: https://github.com/rundeck-plugins/rundeck-winrm-plugin
rundecknode
rundeckauth

getting blank result

did a little digging and found that

knife node list; and get the following request in the logs

2014-01-21T23:24:08Z [email protected] method=GET; path=/organizations/demo/nodes; status=200; req_id=g3IAA2QAEGVyY2hlZkAxMjcuMC4wLjEDAAMtFAAAABYAAAAA; org_name=doyenz; msg={list,3}; req_time=23; rdbms_time=0; rdbms_count=4; couchdb_time=5; couchdb_count=1; authz_time=4; authz_count=1;

and a wget to chef-rundeck; and get the following request in the logs

2014-01-21T23:25:37Z [email protected] method=GET; path=/organizations/demo/search/node?q=:&sort=X_CHEF_id_CHEF_X%20asc&start=0&rows=1000; status=200; req_id=g3IAA2QAEGVyY2hlZkAxMjcuMC4wLjEDAAMw+AAAABYAAAAA; org_name=doyenz; msg={search,3,3,3}; req_time=26; rdbms_time=1; rdbms_count=4; solr_time=8; solr_count=1; couchdb_time=7; couchdb_count=1;

running: private-chef-11.0.2-1.el6.x86_64.rpm
rundeck: rundeck-2.0.0-1-beta1.deb

and I'm starting run-deck like this:

./bin/chef-rundeck -c ~/.chef/knife.rb --host 0.0.0.0

Use expanded run_lists for resolving roles

Currently, if a role contains another role as part of its run_list, chef-rundeck will only report the top-level roles on the node's run_list rather than the expanded list of roles. It would be nice to at least make this configurable.

Rundeck error from OSFamily set to winnt

I am getting the following error on Rundeck 2.6.6 (Windows 2012R2 server) when using the URL resource:

Execute failed: java.io.IOException: Cannot run program "\bin\sh": CreateProcess error=2, The system cannot find the file specified
11:26:02 Failed: NonZeroResultCode: Result code was -1
11:26:02 Execution failed: 5290: [Workflow result: , step failures: {2=Dispatch failed on 1 nodes: [server.domain.com: NonZeroResultCode: Result code was -1]}, Node failures: {server.domain.com=[NonZeroResultCode: Result code was -1]}, status: failed]

When I change the lib/chef-rundeck.rb line 174 from:

os_family = node['kernel_os'] =~ /winnt|windows/i ? 'winnt' : 'unix'

to:
os_family = node['kernel_os'] =~ /winnt|windows/i ? 'windows' : 'unix'

my job executes successfully.

Is there a know issue for this?

Configure arbitrary fields as tags

Take for example the node['ec2']['placement_availability_zone'] -- this is a handy attribute to have in Rundeck. "Deploy X to role:PHP in chef_environment:prod in us-east-1a".

To generalize this, it'd be handy to have in the config file a list of attributes that (if they exist) for a given node should have their value included as a tag, possibly with a predefined static prefix to distinguish them from possible conflicts.

Rakefile issues?

You say:

Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

But I can't seem to run the Rakefile in the form that it is now. I've installed jeweler, rspec, yard ... but apparently this Rakefile expects rspec-1, but the version being installed is a 2.x version that is pretty incompatible.

I'm no Ruby guy so I don't know what is really wrong.

Fix failing spec example

Failures:

  1. ChefRundeck should return false
    Failure/Error: get '/'
    ArgumentError:
    Cannot sign the request without a client name, check that :node_name is assigned

    ./lib/chef-rundeck.rb:42:in `block in class:ChefRundeck'

    ./spec/chef-rundeck_spec.rb:6:in`block (2 levels) in <top (required)>'

Sad Travis :(

Looks like it's having trouble loading up the code-under-test in the current crop of Gemfiles. Don't know why quite yet, I'm just noting it as an issue. I'll take a look at it as time permits.

Environment support?

It would be nice if this got the environment as well and turned it into a tag.

NoMethodError

I am still getting the following error:

Writing to /var/run/chef-rundeck-9980.pid
Puma 1.6.3 starting...

  • Min threads: 0, max threads: 16
  • Environment: development
  • Listening on tcp://localhost:9980
    == Sinatra/1.4.4 has taken the stage on 9980 for development with backup from Puma
    NoMethodError - undefined method []' for nil:NilClass: /usr/lib64/ruby/gems/1.9.1/gems/chef-rundeck-1.0.1/lib/chef-rundeck.rb:59:inblock (2 levels) in class:ChefRundeck'
    /usr/lib64/ruby/gems/1.9.1/gems/chef-rundeck-1.0.1/lib/chef-rundeck.rb:54:in each' /usr/lib64/ruby/gems/1.9.1/gems/chef-rundeck-1.0.1/lib/chef-rundeck.rb:54:inblock in class:ChefRundeck'
    /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:1593:in call' /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:1593:inblock in compile!'
    /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:957:in []' /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:957:inblock (3 levels) in route!'
    /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:976:in route_eval' /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:957:inblock (2 levels) in route!'
    /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:997:in block in process_route' /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:995:incatch'
    /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:995:in process_route' /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:955:inblock in route!'
    /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:954:in each' /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:954:inroute!'
    /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:1067:in block in dispatch!' /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:inblock in invoke'
    /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in catch' /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:ininvoke'
    /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:1064:in dispatch!' /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:889:inblock in call!'
    /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in block in invoke' /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:incatch'
    /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in invoke' /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:889:incall!'
    /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:877:in call' /usr/lib64/ruby/gems/1.9.1/gems/rack-protection-1.5.0/lib/rack/protection/xss_header.rb:18:incall'
    /usr/lib64/ruby/gems/1.9.1/gems/rack-protection-1.5.0/lib/rack/protection/path_traversal.rb:16:in call' /usr/lib64/ruby/gems/1.9.1/gems/rack-protection-1.5.0/lib/rack/protection/json_csrf.rb:18:incall'
    /usr/lib64/ruby/gems/1.9.1/gems/rack-protection-1.5.0/lib/rack/protection/base.rb:49:in call' /usr/lib64/ruby/gems/1.9.1/gems/rack-protection-1.5.0/lib/rack/protection/base.rb:49:incall'
    /usr/lib64/ruby/gems/1.9.1/gems/rack-protection-1.5.0/lib/rack/protection/frame_options.rb:31:in call' /usr/lib64/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/nulllogger.rb:9:incall'
    /usr/lib64/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/head.rb:11:in call' /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/show_exceptions.rb:21:incall'
    /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:180:in call' /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:2004:incall'
    /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:1469:in block in call' /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:1778:insynchronize'
    /usr/lib64/ruby/gems/1.9.1/gems/sinatra-1.4.4/lib/sinatra/base.rb:1469:in call' /usr/lib64/ruby/gems/1.9.1/gems/puma-1.6.3/lib/puma/server.rb:412:inhandle_request'
    /usr/lib64/ruby/gems/1.9.1/gems/puma-1.6.3/lib/puma/server.rb:306:in process_client' /usr/lib64/ruby/gems/1.9.1/gems/puma-1.6.3/lib/puma/server.rb:215:inblock in run'
    /usr/lib64/ruby/gems/1.9.1/gems/puma-1.6.3/lib/puma/thread_pool.rb:94:in call' /usr/lib64/ruby/gems/1.9.1/gems/puma-1.6.3/lib/puma/thread_pool.rb:94:inblock in spawn_thread'

Here is the cli I am using:
/usr/bin/ruby /usr/bin/chef-rundeck -a https://chef.server -k /etc/chef/rundeck.pem -c /etc/chef/chef-rundeck.rb -u rundeck

Ruby version ->
ruby 1.9.3p429 (2013-05-15 revision 40747) [x86_64-linux]

Cert isn't self signed. How can I troubleshoot this? Thanks!

Support partial search on Chef 11 endpoints

If we're talking to a Chef 11 server, we should use partial search. This may help in cases where chef-rundeck is searching a large organization and/or dealing with large search results...

Using chef-rundeck from command prompt in windows

Why does running the following from a command prompt result in an error,

C:>chef-rundeck config_file = "knife.rb"

here is the error message

The filename = config.rb
C:/Ruby193/lib/ruby/gems/1.9.1/gems/mixlib-config-2.1.0/lib/mixlib/config.rb:48:in `read': No such file or directory

  • config.rb (Errno::ENOENT)
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mixlib-config-2.1.0/lib/mixlib/config.rb:48:in from_file' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/chef-rundeck-1.0.1/lib/chef-rundeck.rb:47:inconfigure'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/chef-rundeck-1.0.1/bin/chef-rundeck:82:in <top (required)>' from C:/Ruby193/bin/chef-rundeck:23:inload'
    from C:/Ruby193/bin/chef-rundeck:23:in `'

Handle missing log_level in client.rb

The chef_client cookbook does not set a log_level, and the documentation says to allow the default Chef 11 values to apply. Chef-rundeck breaks if log_level is not in the client.rb file. The default for that value is now 'auto'.

Make the Attribute Reported as Hostname Configurable

It would be nice if the attribute which is reported as the hostname to Rundeck was configurable. So that Rundeck can use any of the attributes returned by Chef to connect to the VMs.
For example to use the nodename instead of the hostname. Not every network setup let's you connect to the VMs using the hostname of the VM.
This would also help with the tickets #59 and #4.

Why is the Chef.username used in the Node Xml?

The resource xml generated by the plugin adds the Chef.username as an attribute to the Node Xml that is being generated. This indicates that the username used to login to the Chef repo and access the Node data is the same username used by the Rundeck node executors to execute a job that has been assigned to a Node. I came across this when I was testing uncheck winrm node executor. Is this right? What if your node executors should execute by using some other password?

Cannot execute command on remote nodes

Hi,
I'd like to seek help on how can I set my Rundeck nodes in the column user@host. It seems that I was able to fetch the nodes from my Chef server but can't execute the command because the User @ Host column is stated as (unset). Any help will be appreciated. Thanks in advance!

custom_attributes undocumented

The project file requires the username attribute otherwise a search fails with:

[2014-06-20T19:47:54-04:00] ERROR: === could not generate xml for {"name"=>"xxx", "chef_environment"=>"prod", [REDACTED], "kernel_machine"=>"x86_64", "kernel_os"=>"GNU/Linux", "platform"=>"centos", "platform_version"=>"6.4", "virtualization_system"=>"xen"}: undefined method `unpack' for nil:NilClass.

The minimum required attributes for the project file should be documented.

Work with a client/node name of node[:fqdn]

When using the "chef-client::config" recipe
And the Chef::Config[:node_name] == node["fqdn"]
Then "/etc/chef/client.rb" has no "node_name" attribute

So when using chef-client -c /etc/chef/client.rb
Then there is an "ArgumentError" with message "Cannot sign the request without a client name, check that :node_name is assigned"

Instead, if the config file contains no client name or node name
chef-client should use "node[:fqdn]"

Perf improvement: make api requests in parallel

Making http requests in serial is extremely slow. If we really need a pure ruby solution, we should at least be using net-http-persistant. If we can get away with requiring libcurl, typhoeus is ideal. Faraday provides a single ruby API for both of these, and more back ends.

It's probably going to involve rewriting most of the internals of Chef::REST. Because obviously that yak needs shaving.

Support multiple searches

Currently, chef-rundeck supports connecting to a single Chef endpoint and running a single Chef search against that endpoint.

It would be great if chef-rundeck could handle multiple searches per endpoint. (We'd also like to be able to search against multiple endpoints)

There are forks of chef-rundeck that do this, so perhaps we'll integrate one of them (with the author's permission, of course) into the main codebase.

please show a working example

I have a running chef server and cannot actually make any sense of how this works....

I have used the debian package method:

http://wiki.opscode.com/display/chef/Installing+Chef+Server+on+Debian+or+Ubuntu+using+Packages

for installing the chef server. I have a couple clients in place....

To properly install the plugin i had to also install:

gcc
ruby1.8-dev

After getting past this....

I am trying to understand this command line:

sudo -b chef-rundeck -c /etc/chef/client.rb -u rundeck -w https://manage.opscode.com/

What does the -u flag actually do:

-u, --username USERNAME          The Username for Rundeck to SSH as

?

When I run it this is what happens (and after connecting to the rundeck server)

root@xcomm-chefserver:~# /var/lib/gems/1.8/gems/chef-rundeck-0.1.0/bin/chef-rundeck -c /etc/chef/client.rb -w http://localhost:4000
== Sinatra/1.3.1 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
ArgumentError - Cannot sign the request without a client name, check that :node_name is assigned:
/usr/lib/ruby/vendor_ruby/chef/rest/auth_credentials.rb:41:in signature_headers' /usr/lib/ruby/vendor_ruby/chef/rest.rb:321:inauthentication_headers'
...
...

Do i have to deal with ssl certificates here?

Is there any other documentation that shows how this might work?

Missing node information - Fixed

Hi,
I have encountered a problem with chef-rundeck, the error is:

NoMethodError - undefined method []' for nil:NilClass: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-rundeck-1.0.1/lib/chef-rundeck.rb:62:inblock (2 levels) in class:ChefRundeck'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-rundeck-1.0.1/lib/chef-rundeck.rb:57:in each' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-rundeck-1.0.1/lib/chef-rundeck.rb:57:inblock in class:ChefRundeck'

My Chef-rundeck is running on the client as I will move it to the server when I have fully tested it. I am using SuSE Linux 11 SP3, Ruby 1.9.3 on both server and client, on the server is installed chef-server 11.0.8-1 and chef 11.6.0 and on the client chef 11.8.4

I debugged the file chef-rundeck-1.0.1/lib/chef-rundeck.rb and, referencing these lines:

rest = Chef::REST.new(ChefRundeck.api_url, ChefRundeck.username, ChefRundeck.client_key)
nodes = rest.get_rest("/nodes/")
nodes.keys.each do |node_name|
  node = rest.get_rest("/nodes/#{node_name}")

at some point, the variable node doesn't contain the expected values. It's like it is not set for one of my nodes.

I think the script should check for all the values he uses before writing the output, so After the line

    node = rest.get_rest("/nodes/#{node_name}")

I added these lines:

  # Sometimes node information are missing. I check that all the required keys are present, otherwise I skip
  key_check = [ "kernel", "fqdn", "platform", "platform_version", "tags" ]
  if (node.keys & key_check).count != key_check.count then next end

I hope this helps!

chef-rundeck sinatra SSL error

HI,
First my chef server is a linux box. Rundeck server is on Win 2012 R2. Initially when I tried it used to work fine. I was trying to make a new node as a Rundeck box and its kicking me out.

I'm getting an SSL error when Sinatra tires to connect the chef server.

ERROR: SSL Validation failure connecting to host: 10.250.4.7 - SSL_connect returned=1 errno=0 state=error: certificate verify failed.

This is the command which I run on chefdk.
chef-rundeck -c C:\chef-repo.chef\knife.rb https:\10.250.4.7\organizations\ey_fids

knife.rb is fine pem key is good.

I'm attaching the files of the error and the process I followed to integrate.
error
rundeck work.docx

Reload Nodes on Signal

It would be nice if a reload of the nodes could be triggered by a signal. For example SIGHUP.

An example use case is a Rundeck Job which creates new nodes and then runs another job on these new nodes. After creating the nodes the first job would kill -SIGHUP chef-rundeck so that the second job sees the new nodes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.