pe_slack_bot
Version information
This version is compatible with:
- Puppet Enterprise >=2015.2.0 < 2016.2.0
Start using this module
Add this module to your Puppetfile:
mod 'ncorrare-pe_slack_bot', '1.0.2'
Learn more about managing modules with a PuppetfileDocumentation
pe_slack_bot
Table of Contents
- Overview
- Setup - The basics of getting started with skel
- Limitations - OS compatibility, etc.
- 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.
Dependencies
- puppetlabs-stdlib (4.x)
- puppetlabs-vcsrepo (1.x)