Code Monkey home page Code Monkey logo

better-chef-rundeck's Introduction

Better Chef Rundeck

GitHub release Travis

A Sinatra app for integrating Chef and Rundeck - a Chef search query is sent as an HTTP GET request to the app at the path /<key>:<search_term> and the app will query the Chef server and return the nodes and their attributes in a format suitable for a Rundeck project's resource model source.

Overview

This app allows defining a Chef node search query right in the path of an HTTP request. For example:

GET /role:webserver

will return all nodes that match the node search query role:webserver in a format that Rundeck can parse for a project. A Rundeck project can be configured to use this url as the resource model source in the project's project.properties:

resources.source.1.type=url
resources.source.1.config.url=http\://better-chef-rundeck.example.com/role:webserver

The returned data includes Chef attributes that will be attached to nodes in Rundeck, allowing users to search for nodes in Rundeck based on Chef attributes.

Additionally, you can specify specific organization if you have multiple chef organization.

GET /<organization>/role:webserver

Above request will return the same result if you type the full name of your default organization. By chaning value of , you can query the same request to other existing chef organizations.

Improvements from the chef-rundeck Gem

The biggest issue with oswaldlabs/chef-rundeck is that project node searches are defined in a config file (/etc/chef/rundeck.json). Updating a project's node search with chef-rundeck requires updating /etc/chef/rundeck.json and then restarting chef-rundeck. Defining a Rundeck project's Chef node search query in /etc/chef/rundeck.json separate from the rest of the Rundeck project configuration (project.properties) doesn't make sense. better-chef-rundeck allows updating a Rundeck project's node search by simply updating the resource model source url in project.properties.

Running the App

Local Development

This gem is not yet production ready or available from rubygems. Until then, clone the project, and install dependencies with bundle install. Then run the app for local devlopment:

bundle exec rackup

The app will look for a knife.rb or / then client.rb to configure its Chef server api calls by default.

Try out the app at localhost:9292.

Optionally, configure a few things specific to the app using environment variables - these are defined a bit further down. You can also specify web server-type config options with rackup arguments, run bundle exec rackup --help to learn more about these.

The app can also be run locally with Passenger standalone like it would be run in production:

bundle exec passenger start

In Production

This app can easily be run with Passenger standalone. Passenger's standalone server is reliable enough to run an internal only app that handles a small amount of traffic. The basic steps are:

  1. Clone the app from the GitHub repo
  2. Install dependencies with bundle install --deployment --without development test
  3. Run the app: bundle exec passenger start --environment production

Additionally, configure the app with a Passengerfile.json or passenger's command line arguments. Here is a reference for those config options. In addition to common web server-type config options, there are config options specific to this app that can be configured with environment variables. These can be set in the shell of the user running the app with export ENVVAR=VALUE, or with passenger command line args or Passengerfile.json. These options are described below:

With Docker

docker build -t better-chef-rundeck .
docker run -d -p 80 -v $HOME/.chef:/home/app/.chef better-chef-rundeck

Configuration

The app is configured with shell environment variables. These env vars are namespaced to not be overwritten by other programs. It should be clear that the app will run fine with the default configuration, and setting any of these env vars is not required.

Environment Variable Explanation Default Value
BCR_CHEF_CONFIG Path to a Chef config file First that exists in ['~/.chef/knife.rb', '/etc/chef/client.rb']

Using the API

Which Attributes to Return from Chef

Read filtering Chef search returned attributes for information about filter_result (sometimes referred to as partial_search).

Seriously, go read it. It's not even long and it will make understanding this next bit much easier.

Specify which Chef node attributes should be in the returned data (filter_result) using GET parameters. If these GET parameters are not set, the normal Chef attributes will be returned (which may or may not be what is wanted, especially in a very large environment). Specify the attribute name as the GET param and the Chef attribute path as a comma-delimited list (some,attribute,path, languages,ruby,version) as the value of the GET param. So to convert the attribute ['really']['deep']['attr'] into the attribute short, use the GET param short=really,deep,attr. If a value is not provided for the GET param, the key will be used as the value (?ipaddress=ipaddress is unnecessary, you can get the same result with ?ipaddress).

Example filter_result GET parameters

Chef node:

---
somenode:
  ipaddress: 10.11.12.13
  kernel:
    version: 7.8.9
  languages:
    ruby:
      version: 2.1.0

Request:

# GET /name:somenode?ipaddress&kernel_version=kernel,version&ruby_version=languages,ruby,version

---
somenode:
  ipaddress: 10.11.12.13
  kernel_version: 7.8.9
  ruby_version: 2.1.0

Default filter_result attributes

If no attributes are specified for filter_result, the Chef node attributes returned will be very similar to running knife search node QUERY. But if any values are specified for filter_result, these default node attributes will not be returned; they will have to be explicitly requested in the filter_result GET parameters.

Chef node:

---
anothernode:
  environment: prod
  fqdn: anothernode.example.com
  ipaddress: 100.101.102.103
  run_list: recipe[base_os], role[webserver]
  roles: webserver
  platform: redhat
  tags:
    rundeck-managed
    some-tag

A request without specifying filter_result GET params would return exactly the data above. But a request specifying only the filter_result GET params ip=ipaddress and ruby_version=languages,ruby,version will not get all the attributes back because the request did not specify them:

# GET /name:anothernode?ip=ipaddress&ruby_version=languages,ruby,version

---
anothernode:
  ip: 100.101.102.103
  ruby_version: 2.2.3

default_ing and override_ing Attributes

Set GET parameters to default and override node attributes. Set the GET parameter default_<attr>=<value> to default <attr> to <value> (defaults if the attribute value is nil or the attribute is not set for the node). Similarly, set the GET parameter override_<attr>=<value> to set <attr> to <value> for all nodes returned.

A common use case for default_ or override_ attributes is setting the attribute username to the value ${option.username} for usage in remote ssh logins in a Rundeck job as a job option.

To illustrate this, three Chef nodes with different attributes (some attributes unset, some nil):

---
nodea:
  domain: example.com
  ruby_version: 2.1.0
nodeb:
  domain: different.co
  ruby_version:
  username: rundeck_svc_acct
nodec:
  domain:
  ruby_version:

This request would return something similar to the following:

# GET /*:*?default_domain=github.com&override_ruby_version=2.2.0&default_username=${option.username}

---
nodea:
  domain: example.com
  ruby_version: 2.2.0
  username: ${option.username}
nodeb:
  domain: different.co
  ruby_version: 2.2.0
  username: rundeck_svc_acct
nodec:
  domain: github.com
  ruby_version: 2.2.0
  username: ${option.username}

append_ing Attributes

In order to append static text to node attributes, set the GET parameter append_<attr>=<value> to append <value> to <attr> (you can combine this with default_ or override_).

A use case for append_ attributes is setting the SSH port of nodes (in case all your nodes have non-standard SSH ports)

To illustrate this, three Chef nodes with different attributes (some attributes unset, some nil):

---
nodea:
  fqdn: nodea
nodeb:
  fqdn: nodeb
nodec:
  fqdn: nodec

This request would return something similar to the following:

# GET /*:*?hostname=fqdn&append_hostname=:22222

---
nodea:
  fqdn: nodea:22222
nodeb:
  fqdn: nodeb:22222
nodec:
  fqdn: nodec:22222

Merging attributes in tags attribute

In order to merge the values of multiple attributes in the tags attribute, you can set the tags GET parameter to the list of attributes you want to merge joined with $$$. The result for the tags attribute will then be flattened. For example:

Chef node:

---
anothernode:
  environment: prod
  fqdn: anothernode.example.com
  ipaddress: 100.101.102.103
  run_list: 
  - recipe[base_os]
  - role[webserver]
  roles:
  - webserver
  platform: redhat
  tags:
  - rundeck-managed
  - some-tag
# GET /name:anothernode?env=environment&roles&tags=environment$$$roles$$$run_list$$$tags

---
anothernode:
  env: prod
  roles:
  - webserver
  tags:
  - prod
  - webserver
  - recipe[base_os]
  - role[webserver]
  - rundeck-managed
  - some-tag

Contributing

  1. Fork the repo in GitHub
  2. Create a branch (with a logical name like feat/x or fix/y)
  3. Make your changes (and add applicable tests)
  4. Create a pull request

Testing

Tested with rspec and chef-zero. You can execute the tests with:

$ bundle
$ bundle exec rspec

Tests are built with Travis CI on all pushes. Tests require chef-zero, which requires Ruby version >= 2.1.0, so tests are only run for those versions of Ruby. However, the app itself should work on older versions of Ruby.

better-chef-rundeck's People

Contributors

atheiman avatar donaldguy avatar jiokmiso avatar siebertm avatar spion06 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

better-chef-rundeck's Issues

URI escape default_ and override_ GET params

Only apply URI.escape to special characters in default_ and override_ GET params.

Only chars I've found that explicitly need URI encoding are curly braces:

  • ?default_username=$option.username works fine
  • ?default_username=${option.username} returns a 400 Bad Request:
bad URI `/chef_environment:ets_alpha_build_65?default_username=${option.username}'.

Note that calling URI.escape multiple times has likely undesired effects because it escapes %:

irb(main):001:0> require 'uri'
=> true
irb(main):002:0> URI.escape '${option.username}'
=> "$%7Boption.username%7D"
irb(main):003:0> URI.escape '$%7Boption.username%7D'
=> "$%257Boption.username%257D"

Missing attribute for rundeck SSH plugin

Rundeck SSH Plugin requires hostname attribute with the node in order to create a connection as stated here in the docs:
http://rundeck.org/2.7.3/plugins-user-guide/ssh-plugins.html

Adding a hostname field fixed this for me. Could possibly just replace the fqdn field with hostname.

`index 2e708bf..8488b35 100644
--- a/lib/better_chef_rundeck.rb
+++ b/lib/better_chef_rundeck.rb
@@ -58,6 +58,7 @@ class BetterChefRundeck < Sinatra::Base
default_filter_result = {
environment: ['chef_environment'],
fqdn: ['fqdn'],

  •  hostname:    ['fqdn'],
     ip:          ['ipaddress'],
     run_list:    ['run_list'],
     roles:       ['roles'],`
    

Can't compile with Chef 13

Hi!

I'm try to compile better-chef-rundeck with Chef 13... and don't work.
With Chef 13 the same cookbook recipe, install better-chef-rundeck without any problem.

The output:

       ---- Begin output of /opt/chef/embedded/bin/bundle install --deployment --without development test ----
       STDOUT: `/root` is not writable.
       Bundler will use `/tmp/bundler/home/vagrant' as your home directory temporarily.
       Fetching gem metadata from https://rubygems.org/..........
       Fetching version metadata from https://rubygems.org/...
       Fetching dependency metadata from https://rubygems.org/..
       Installing rake 11.2.2
       Installing builder 3.2.2
       Using bundler 1.14.6
       Installing fuzzyurl 0.8.0
       Installing mixlib-config 2.2.1
       Installing mixlib-shellout 2.2.6
       Installing libyajl2 1.2.0 with native extensions
       Installing hashie 3.4.4
       Installing mixlib-log 1.6.0
       Installing rack 1.6.4
       Installing uuidtools 2.1.5
       Installing diff-lcs 1.2.5
       Installing erubis 2.7.0
       Installing highline 1.7.8
       Installing iniparse 1.4.2
       Installing mixlib-cli 1.6.0
       Installing net-ssh 3.1.1
       Installing ffi 1.9.10 with native extensions
       Installing ipaddress 0.8.3
       Installing plist 3.2.0
       Installing systemu 2.6.5
       Installing wmi-lite 1.0.0
       Installing proxifier 1.0.3
       Installing rspec-support 3.4.1
       Installing multi_json 1.12.1
       Installing net-telnet 0.1.1
       Installing sfl 2.2
       Installing syslog-logger 1.6.8
       Installing tilt 2.0.5
       Installing chef-config 12.11.18
       Installing ffi-yajl 2.2.3 with native extensions
       Installing mixlib-authentication 1.4.1
       Installing passenger 5.0.28 with native extensions
       Installing rack-protection 1.5.3
       Installing net-sftp 2.1.2
       Installing net-ssh-gateway 1.2.0
       Installing net-scp 1.2.1
       Installing rspec-core 3.4.4
       Installing rspec-expectations 3.4.0
       Installing rspec-mocks 3.4.1
       Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
       
       current directory:
       /opt/plugins/better-chef-rundeck/vendor/bundle/ruby/2.4.0/gems/ffi-yajl-2.2.3/ext/ffi_yajl/ext/encoder
       /opt/chef/embedded/bin/ruby -r ./siteconf20170612-5176-1vgdplc.rb extconf.rb
       -I/opt/plugins/better-chef-rundeck/vendor/bundle/ruby/2.4.0/gems/libyajl2-1.2.0/lib/libyajl2/vendored-libyajl2/include
       -I/opt/chef/embedded/include -O2 -O3 -g -pipe -fPIC
       -L/opt/plugins/better-chef-rundeck/vendor/bundle/ruby/2.4.0/gems/libyajl2-1.2.0/lib/libyajl2/vendored-libyajl2/lib
       -L. -Wl,-rpath,/opt/chef/embedded/lib -fstack-protector -L/opt/chef/embedded/lib
       -rdynamic -Wl,-export-dynamic -L/opt/chef/embedded/lib 
       -Wl,-R/opt/chef/embedded/lib
       checking for yajl/yajl_tree.h... yes
       creating Makefile
       
       current directory:
       /opt/plugins/better-chef-rundeck/vendor/bundle/ruby/2.4.0/gems/ffi-yajl-2.2.3/ext/ffi_yajl/ext/encoder
       make "DESTDIR=" clean
       
       current directory:
       /opt/plugins/better-chef-rundeck/vendor/bundle/ruby/2.4.0/gems/ffi-yajl-2.2.3/ext/ffi_yajl/ext/encoder
       make "DESTDIR="
       compiling encoder.c
       encoder.c: In function ‘Init_encoder’:
       encoder.c:380:20: error: ‘rb_cFixnum’ undeclared (first use in this function)
          rb_define_method(rb_cFixnum, "ffi_yajl", rb_cFixnum_ffi_yajl, 2);
                    ^
       encoder.c:380:20: note: each undeclared identifier is reported only once for
       each function it appears in
       encoder.c:381:20: error: ‘rb_cBignum’ undeclared (first use in this function)
          rb_define_method(rb_cBignum, "ffi_yajl", rb_cBignum_ffi_yajl, 2);
                    ^
       make: *** [encoder.o] Error 1
       
       make failed, exit code 2
       
       Gem files will remain installed in
       /opt/plugins/better-chef-rundeck/vendor/bundle/ruby/2.4.0/gems/ffi-yajl-2.2.3
       for inspection.
       Results logged to
       /opt/plugins/better-chef-rundeck/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0/ffi-yajl-2.2.3/gem_make.out
       
       An error occurred while installing ffi-yajl (2.2.3), and Bundler cannot
       continue.
       Make sure that `gem install ffi-yajl -v '2.2.3'` succeeds before bundling.
       STDERR: 
       ---- End output of /opt/chef/embedded/bin/bundle install --deployment --without development test ----
       Ran /opt/chef/embedded/bin/bundle install --deployment --without development test returned 5
       [2017-06-12T13:36:12+00:00] ERROR: execute[bundle_install] (fif_rundeck::chef_rundeck line 35) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '5'

Support more than 1000 nodes

Currently, better-chef-rundeck only returns the first 1000 nodes that match the search criteria. We need the ability to return 5000+ nodes that match.

paginate through all results from chef query

chef_nodes = Chef::Search::Query.new.search(:node, query, filter_result: filter_result)[0]

should be

chef_nodes = []
Chef::Search::Query.new.search(:node, query, filter_result: filter_result) do |n|
  chef_nodes << n
end

Docker dependency issue with ruby

Building the docker container will fail due to unresolved ruby versions.

error:

% docker build -t better-chef-rundeck .
[+] Building 16.1s (8/10)
 => [internal] load build definition from Dockerfile                                                                        0.0s
 => => transferring dockerfile: 636B                                                                                        0.0s
 => [internal] load .dockerignore                                                                                           0.0s
 => => transferring context: 2B                                                                                             0.0s
 => [internal] load metadata for docker.io/phusion/passenger-ruby21:latest                                                  1.8s
 => [1/7] FROM docker.io/phusion/passenger-ruby21@sha256:e09f5860b2bba8bc5813dd8fa0b894a8320ef411bf1e15a621f7782252569203   0.0s
 => CACHED [2/7] WORKDIR /home/app                                                                                          0.0s
 => CACHED [3/7] RUN git clone https://github.com/atheiman/better-chef-rundeck                                              0.0s
 => CACHED [4/7] WORKDIR /home/app/better-chef-rundeck                                                                      0.0s
 => ERROR [5/7] RUN bash -c 'sed -i"" -e "/passenger/s/~> 5.0/= $(passenger --version | grep -o '5.*')/" Gemfile' &&       14.2s
------
 > [5/7] RUN bash -c 'sed -i"" -e "/passenger/s/~> 5.0/= $(passenger --version | grep -o '5.*')/" Gemfile' &&     cat Gemfile && bundle update passenger &&     bundle install:
#8 0.580 source 'https://rubygems.org'
#8 0.580
#8 0.580 gem 'chef'
#8 0.580 gem 'passenger', require: 'phusion_passenger/rack_handler'
#8 0.580 gem 'sinatra'
#8 0.580
#8 0.580 group :development do
#8 0.580   gem 'chef-zero'
#8 0.580   gem 'rack-test'
#8 0.580   gem 'rubocop'
#8 0.580   gem 'sinatra-contrib'
#8 0.580 end
#8 5.320 Fetching gem metadata from https://rubygems.org/........
#8 13.87 Fetching gem metadata from https://rubygems.org/.
#8 13.92 Resolving dependencies...
#8 14.08 Bundler could not find compatible versions for gem "ruby":
#8 14.08   In Gemfile:
#8 14.08     ruby
#8 14.08
#8 14.08     chef was resolved to 13.6.4, which depends on
#8 14.08       bundler (>= 1.10) was resolved to 1.16.3, which depends on
#8 14.08         ruby (>= 1.8.7)
#8 14.08
#8 14.08     sinatra was resolved to 2.0.0, which depends on
#8 14.08       rack (~> 2.0) was resolved to 2.1.4, which depends on
#8 14.08         ruby (>= 2.2.2)
------
executor failed running [/bin/sh -c bash -c 'sed -i"" -e "/passenger/s/~> 5.0/= $(passenger --version | grep -o '5.*')/" Gemfile' &&     cat Gemfile && bundle update passenger &&     bundle install]: exit code: 6

However, running bundle update across all gems, rather than only passenger, lets it complete (and run) fine:

diff:

 % git diff
diff --git a/Dockerfile b/Dockerfile
index 9b30353..4e3a5aa 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -5,7 +5,7 @@ WORKDIR /home/app
 RUN git clone https://github.com/atheiman/better-chef-rundeck
 WORKDIR /home/app/better-chef-rundeck
 RUN bash -c 'sed -i"" -e "/passenger/s/~> 5.0/= $(passenger --version | grep -o '5.*')/" Gemfile' && \
-    cat Gemfile && bundle update passenger && \
+    cat Gemfile && bundle update && \
     bundle install

 USER root

result:

 % docker build -t better-chef-rundeck .
[+] Building 0.9s (11/11) FINISHED
 => [internal] load build definition from Dockerfile                                                                        0.0s
 => => transferring dockerfile: 626B                                                                                        0.0s
 => [internal] load .dockerignore                                                                                           0.0s
 => => transferring context: 2B                                                                                             0.0s
 => [internal] load metadata for docker.io/phusion/passenger-ruby21:latest                                                  0.8s
 => [1/7] FROM docker.io/phusion/passenger-ruby21@sha256:e09f5860b2bba8bc5813dd8fa0b894a8320ef411bf1e15a621f7782252569203   0.0s
 => CACHED [2/7] WORKDIR /home/app                                                                                          0.0s
 => CACHED [3/7] RUN git clone https://github.com/atheiman/better-chef-rundeck                                              0.0s
 => CACHED [4/7] WORKDIR /home/app/better-chef-rundeck                                                                      0.0s
 => CACHED [5/7] RUN bash -c 'sed -i"" -e "/passenger/s/~> 5.0/= $(passenger --version | grep -o '5.*')/" Gemfile' &&       0.0s
 => CACHED [6/7] RUN echo 'server {\n  listen 80;\n  root /home/app/better-chef-rundeck/public;\n  passenger_enabled on;\n  0.0s
 => CACHED [7/7] RUN rm /etc/nginx/sites-enabled/default && rm /etc/service/nginx/down                                      0.0s
 => exporting to image                                                                                                      0.0s
 => => exporting layers                                                                                                     0.0s
 => => writing image sha256:c4820b7354ac7c2a8691060cb0f1ed29bcffd4de874a078a7fed5c58fb82c9cc                                0.0s
 => => naming to docker.io/library/better-chef-rundeck                                                                      0.0s

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them

That's probably not the best solution moving forward, but it'll unblock anyone that wants to try it out.

Unable to fetch node details in rundeck

We are running better-chef-rundeck inside docker container but we are running two containers for 2 regions. same configuration has been done in both the containers but from one container we are unable to fetch node data.

URL for dallas region nodes =http://172.17.0.3:8080/os:linux?name=hostname&override_username=msdomain1\rundeckadmin1&hostname=ipaddress&ip=ipaddress&tags=chef_environment&osArch=kernel,machine&os&platform&platform_version&roles&fqdn&recipes&chef_name=name&mstar_metadata=mstar_metadata&region=mstar_classification,region Timeout: 30

Error : node(s) missing name attribute. You've overriden the name attribute to the attribute path hostname in your GET parameters name=hostname&override_username=inetcontrol&hostname=ipaddress&ip=ipaddress&tags=chef_environment&osArch=kernel,machine&os&platform&platform_version&roles&fqdn&recipes&chef_name=name

But 2nd URL is working properly which is for chicago server nodes.

http://172.17.0.2:8080/os:linux?name=hostname&override_username=msdomain1\rundeckadmin1&hostname=ipaddress&ip=ipaddress&tags=chef_environment&osArch=kernel,machine&os&platform&platform_version&roles&fqdn&recipes&chef_name=name&mstar_metadata=mstar_metadata&region=mstar_classification,region Timeout: 30

Both the containers are working properly we did not see any error in docker logs. also chef server is up and running properly. on chef servers in knife node list all node are showing correctly but those details are not able to fetch in rundeck.

We got error in rundeck service.log

image
rundeck_error

This is old setup previously it was working fine but suddenly we started to face this issue.

curl "http://172.17.0.2:8080"
curl "http://172.17.0.3:8080" for both of this commands we are getting output.
better-chef-rundeck is up and running!

parsing error with new version of Rundeck 2.9.3

Rundeck 2.9.3 requires Java version 1.8 which appears to be the cause of the following error:

aused by: com.dtolabs.rundeck.core.common.NodeFileParserException: mapping values are not allowed here
in "", line 2, column 12:
chef_config: /var/lib/rundeck/.chef/knife.rb
^

at com.dtolabs.rundeck.core.common.NodesYamlParser.parse(NodesYamlParser.java:130)
at com.dtolabs.rundeck.core.resources.format.ResourceYamlFormatParser.parseDocument(ResourceYamlFormatParser.java:65)
... 84 more

Caused by: mapping values are not allowed here

I've attempted to set the chef_config variable via the ENV var as well as in a Passengerfile.json and in the config.ru itself to no avail.

Chef Search Doesn't Include Hostname Attribute for Rundeck

I've got this working in Rundeck, but jobs won't run because the node attributes created from Chef don't include a "hostname".

Here's a node:

db02:
  environment: testing
  fqdn: db02.here.com
  ip: 10.50.2.82
  run_list:
  - recipe[base]
  - recipe[db]
  roles: []
  platform: centos
  tags: []

When I try to run jobs or commands I get:
java.lang.IllegalArgumentException: Null hostname value

I've tried overriding the hostname in the node request from Chef, indicated in your README, like "http://127.0.0.1:9292/*:*?default_hostname=${node.fqdn}", but the jobs don't seem to want to use an option like that when they run.

I'm probably doing something wrong here. If you can help point me in the right direction I would appreciate it.

tags cannot be nil in rundeck

in the case where Tags are nil in Chef, they will need to default to [] so that Rundeck doesn't throw this error.
Caused by: java.lang.NullPointerException
at com.dtolabs.rundeck.core.common.NodeEntryImpl.setTags(NodeEntryImpl.java:127)

Could either add:
if node['tags'].nil?
node['tags'] = []
end

or figure out how to make ?default_tags=[] work?

BCR with Multiple Orgs

In our current implementation of Chef, we have different organizations. Is there a way to use better-chef-rundeck with multiple chef organizations? If so, How could I implement this?

Thanks.

support multiple chef orgs

authentication to the chef server just needs one key and then permission to the orgs it requests searches from. simple implementation allowing support for multiple orgs:
requests to the app follow /<org>/<query>

examples:

  • GET /org-a/tags:some-tag
  • GET /org-b/tags:some-tag

each of those requests would hit their respective chef servers

to allow backwards compatibility, the chef org could be a get parameter.

Possibly in the future this could even support multiple chef servers.

assign multiple attributes to tags?

Hi, just getting started with better-chef-rundeck, and wondering if something like this is possible:
To add multiple different attributes from chef as rundeck tags.
For example:
If I wanted to use platform and platform_version as tags, I would try something like this:
?tags=platform&tags=platform_version
or
?tags=platform&tags+=platform_version

I know neither of these is possible, just throwing the idea out there to see if anyone else thinks it would be useful. I know I can just assign said attributes to their own individual rundeck attributes, and that can be made to work, but the tags seem a little more flexible, and wondering how to add multiple tags.

version

there should be a version attribute

Could not find rake-13.0.1 in any of the sources (Bundler::GemNotFound)

Recent Docker builds of better-chef-rundeck are resulting in a runtime failure with the following error:

App 75 output: Error: The application encountered the following error: Could not find rake-13.0.1 in any of the sources (Bundler::GemNotFound)
App 75 output: /usr/local/rvm/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/bundler/spec_set.rb:91:in block in materialize' App 75 output: /usr/local/rvm/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/bundler/spec_set.rb:85:in map!'
App 75 output: /usr/local/rvm/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/bundler/spec_set.rb:85:in materialize' App 75 output: /usr/local/rvm/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/bundler/definition.rb:170:in specs'
App 75 output: /usr/local/rvm/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/bundler/definition.rb:237:in specs_for' App 75 output: /usr/local/rvm/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/bundler/definition.rb:226:in requested_specs'
App 75 output: /usr/local/rvm/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:108:in block in definition_method' App 75 output: /usr/local/rvm/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:20:in setup'
App 75 output: /usr/local/rvm/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/bundler.rb:107:in setup' App 75 output: /usr/local/rvm/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/bundler/setup.rb:20:in <top (required)>'
App 75 output: /usr/local/rvm/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in require' App 75 output: /usr/local/rvm/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in require'
App 75 output: /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:363:in activate_gem' App 75 output: /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:221:in block in run_load_path_setup_code'
App 75 output: /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:527:in running_bundler' App 75 output: /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:220:in run_load_path_setup_code'
App 75 output: /usr/share/passenger/helper-scripts/rack-preloader.rb:91:in preload_app' App 75 output: /usr/share/passenger/helper-scripts/rack-preloader.rb:189:in block in module:App'
App 75 output: /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:380:in run_block_and_record_step_progress' App 75 output: /usr/share/passenger/helper-scripts/rack-preloader.rb:188:in module:App'
App 75 output: /usr/share/passenger/helper-scripts/rack-preloader.rb:30:in <module:PhusionPassenger>' App 75 output: /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in

'

I expect it a bundler/rake-related issue.

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.