cernops/rundeck-puppetdb-nodes

Name: rundeck-puppetdb-nodes

Owner: CERN Operations

Description: Rundeck plugin to retrieve node definitions from PuppetDB

Created: 2015-02-12 10:14:00.0

Updated: 2017-11-08 05:53:00.0

Pushed: 2016-10-10 15:04:16.0

Homepage: null

Size: 45

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Rundeck PuppetDB Nodes Plugin

Description

This is a Resource Model Source plugin for Rundeck Rundeck version 2.0 (or higher) that retrieves node definitions from PuppetDB.

Developed in Python, it uses python-requests library and Kerberos authentication to connect to the PuppetDB API.

Either the puppetdb API url, the foreman hostgroup, username, and the kerberos keytab path can be specified via plugin parameters on the project's configuration page.

Parameters

PuppetDB - PuppetDB API URL following this format: https://<SERVER>:<PORT>/<API VERSION>

https://my.puppet.db:2525/v3

Foreman Hostgroup - Specify a Foreman hosgroup to filter the query

cloud_workflow or cloud_

Factlist - Space-separated list of facts to retrieve for every node

Kerberos user - Kerberos principal (used alongside 'keytab' to connect to PuppetDB)

Kerberos keytab - Absolute path to kerberos principal's keytab (used to authenticate & connect to PuppetDB)

SSH User - User Rundeck will use to connect to hosts via SSH

Execution Mode - Prints out/stores on file the list of nodes. Select store if you want to cache the result

Output file - Save list of nodes to file (only if 'store' mode selected)

Requirements
Installation

Download the latest .ZIP from the releases page and copy it to /var/lib/rundeck/libext/. Restart the Rundeck service to be sure it gets the lastest changes.

Next time you log in, you will see a new Resource Model Source called PuppetDB Source on the project's configuration page.

Plugin Output example
duler-02.mydomain.com:
hostname: scheduler-02.mydomain.com
username: root
tags:  hostgroup=workflows/scheduler/server
osName: SLC
duler-01.mydomain.com:
hostname: scheduler-01.mydomain.com
username: root
tags:  hostgroup=workflows/scheduler/server
osName: SLC
balancer-01.mydomain.com:
hostname: loadbalancer-01.mydomain.com
username: root
tags:  hostgroup=workflows/ha
osName: SLC
er-02.mydomain.com:
hostname: server-02.mydomain.com
username: root
tags:  hostgroup=workflows/server/production
osName: SLC
balancer-02.mydomain.com:
hostname: loadbalancer-02.mydomain.com
username: root
tags:  hostgroup=workflows/ha
osName: SLC
er-qa-01.mydomain.com:
hostname: server-qa-01.mydomain.com
username: root
tags:  hostgroup=workflows/server/qa
osName: SLC
balancer-qa-01.mydomain.com:
hostname: loadbalancer-qa-01.mydomain.com
username: root
tags:  hostgroup=workflows/ha
osName: SLC
er-qa-03.mydomain.com:
hostname: server-qa-03.mydomain.com
username: root
tags:  hostgroup=workflows/server
osName: CentOS
er-datastore.mydomain.com:
hostname: server-datastore.mydomain.com
username: root
tags:  hostgroup=workflows/datastore
osName: CentOS
er-qa-02.mydomain.com:
hostname: server-qa-02.mydomain.com
username: root
tags:  hostgroup=workflows/server
osName: SLC

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.