Forge Home

pe_slack_bot

A module to configure the pe-slack-bot for interacting with Puppet Orchestrator / PuppetDB

Nicolas Corrarello

ncorrare

9,636 downloads

6,125 latest version

4.6 quality score

Version information

  • 1.0.2 (latest)
  • 1.0.0
  • 0.1.10
  • 0.1.9
  • 0.1.8
  • 0.1.7
  • 0.1.6
  • 0.1.5
  • 0.1.4
  • 0.1.3
  • 0.1.1
  • 0.1.0
released Dec 28th 2016
This version is compatible with:
  • Puppet Enterprise >=2015.2.0 < 2016.2.0
  • RedHat

Start using this module

Documentation

ncorrare/pe_slack_bot — version 1.0.2 Dec 28th 2016

pe_slack_bot

Build Status

Table of Contents

  1. Overview
  2. Setup - The basics of getting started with skel
  3. Limitations - OS compatibility, etc.
  4. Development - Guide for contributing to the module

Overview

This module configures the PE Bot for Slack.

Setup

Setup Requirements

Classify your Master with the pe_slack_bot. You'll need at least to make your $slack_api_key available as a variable. You can get it by clicking the Add to Slack Button below (it will call back to a web page showing your API Key for the bot).

In order to do orchestration tasks, you'll need to configure the right permissions in "Access Control", in the PE Console, and a token in /opt/puppetlabs/server/data/puppetserver/.puppetlabs/token.

The following animations briefly illustrate how to do it, but for more information please refer to the Puppet Enteprise documentation

Beginning with pe_slack_bot

First /invite puppet to your channel. Check the documentation on how to use the bot, or try on of the following:

  • puppet status $certname
  • puppet job list
  • puppet job show $showid
  • puppet app list
  • puppet job run

What pe_slack_bot affects

The bot is designed to run with the Puppet Enterprise Ruby (in order not to affect neither Puppet nor the system ruby). It does however install a number of gems:

  • puma
  • sinatra
  • dotenv
  • slack-ruby-bot
  • puppetdb-ruby
  • foreman
  • json_pure
  • rspec
  • rake-tests

It also creates a configuration file in the Puppet configuration directory (/etc/puppetlabs/puppet by default), and a systemd service to run the bot at start time (after the start of pe-orchestration-services). Finally in clones the master (stable) branch of the bot from https://github.com/ncorrare/pe-slack-bot in /opt/pe-slack-bot. You can specify a $version variable upon classification to fix it to a specific tag.

Limitations

This bot has only been tested in Centos 7, but it should work with most of the certified PE Master operating systems (that use systemd). I'll try to extend the testing to other platforms, and possibly add backwards compatibility to init.d.

Development

Send a PR to either the Puppet module or the bot. I haven't had time to write unit tests yet, but they'll be added shortly. Travis is used for CI so every PR is automatically tested. Upon merging, a new release of the module will be pushed to the forge.