No description, website, or topics provided.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
lib
spec
.document
.gitignore
.travis.yml
Dockerfile
Gemfile
Gemfile.lock
LICENSE
NOTICE
README.md
Rakefile
VERSION
changelog.md
super-chef-rundeck.gemspec

README.md

super-chef-rundeck

A multi use Chef node proxy datasource for Rundeck. It features:

  • REST based interface with filtering via query parameters. Custom ohai attributes can also be used as filters (see below).
  • Can output json format that is compatible for use as a Rundeck remote option provider a.k.a options for your Rundeck jobs.
  • Can output xml format that can be used as a Rundeck remote resource model a.k.a node list.

Usage

The following example requests can be useful as a Rundeck remote option provider

Make a request to the /node endpoint:

$ curl "http://localhost:9980/node"
[ "server1.example.com", "server2.example.com" ]

Filter node by name

$ curl "http://localhost:9980/node?name=server1"
[ "server1.example.com" ]

Filter node by name but output chef_environment instead of name

$ curl "http://localhost:9980/node?name=server1"
[ "dev" ]

Return xml output for use as a Rundeck remote resource model

$ curl "http://localhost:9980/node?format=xml"
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE project PUBLIC "-//DTO Labs Inc.//DTD Resources Document 1.0//EN" "project.dtd"><project>
<node name="server1.example.com"
      type="Node"
      description="..."
      osArch="..."
      osFamily="..."
      osName="..."
      osVersion="..."
      roles="..."
      recipes="..."
      tags="..."
      environment="..."
      username="..."
      hostname="...">
      ...
</node>

The following parameters can be passed to filter the output. Values are matched via regular expression.

Parameter Description Default
format Output format: json or xml can be passed json
name node name filter nil
key for each node that matches request parameters, the value of the attribute to output. Only works for json output name
chef_environment node chef_environment filter nil
roles node roles filter nil
recipes node recipes filter nil
run_list node run_list filter nil
platform node platform filter. For example: debian nil
platform_version node platform_version filter. For example: 16.04 nil
kernel_os node kernel_os filter. For example: GNU/Linux nil
kernel_machine node kernel_machine filter. For example: x86_64 nil

More examples

Filter by name

$ curl "http://localhost:9980/node?name=server1"
[ "server1.example.com" ]

Configuration

  • Pass -c to point to the path of your chef knife.rb/client.rb
  • Pass -t to specify a comma separated list of custom attributes (from your custom ohai plugins for example) that you wish to be included for query request parameter filtering