Code Monkey home page Code Monkey logo

puppet-notifier's Introduction

Puppet-Notifier module

Table of Contents

  1. Description
  2. Setup - The basics of getting started with notifier
  3. Usage - Configuration options and additional functionality
  4. Reference - An under-the-hood peek at what the module is doing and how
  5. Limitations - OS compatibility, etc.
  6. Development - Guide for contributing to the module

Description

This module allows you to send managed Puppet reports into Skype, Slack and Telegram about status changes on your infrastructure on every Puppet run. Reports would be sent for you if the status equals changed or failed. Integration with PuppetBoard included!

Setup

Installation

It is vital to install this module into core modules folder of your Puppetserver (i.e /etc/puppetlabs/code/modules)!

Skyper

  1. Create the Skype bot at BotFramework. Catch the Application ID and Application secret values.
  2. Create conversation in Skype, add bot and write '/get name' in IM to gather chat ID.

Slacker

You just need to add new webhook for your team here. No additional modifications required. Webhook would be in format https://hooks.slack.com/services/ABC/123/QWE

Telegramer

  1. Find the @BotFather contact
  2. Write /newbot and pass through multiple questions.
  3. Get the access token from the answer.
  4. Add your new bot into channel and write something like @YOURBOT hello
  5. Open https://api.telegram.org/bot<ACCESS_TOKEN>/getUpdates and find the chat id variable.

Usage

Simply add the class of the service you want to use into your manifest within Puppetserver node:

node 'puppetserver' {

  $puppetboard_link = 'http://172.16.100.101/puppetboard/'
  class { 'notifier::skyper':
    chat_id => '[email protected]',
    client_id => 'someclientid',
    puppetboard => $puppetboard_link,
    client_secret => 'someclientsecret'
  }
  class { 'notifier::slacker':
    hook_url => 'https://hooks.slack.com/services/ABC/123/QWE',
    username => 'Puppet Notifier',
    channel  => '#puppet-test',
    puppetboard => $puppetboard_link,
    icon_url => 'https://www.404techsupport.com/wp-content/uploads/2014/06/puppet-labs-featured.png'
  }
  class { 'notifier::telegramer':
    token => 'your_bot_token',
    chat_id => 'chat_id_from_api',
    send_stickers  => 'true',
    puppetboard => $puppetboard_link
  }

}

Reference

notifier::skyper

chat_id - your conversation ID from '/get name' command client_id - Application ID from BotFramework client_secret - Application Secret puppetboard - Link to your Puppetboard

notifier::slacker

hook_url - your Incoming Webhook URL channel - where to send reports username - bot name which send reports icon_url - small image which stands for bot avatar

notifier::telegramer

token - access key from BotFather chat_id - conversation ID from API send_stickers - should your bot send telegram stickers with report based on his status or not. Remove this attribute to disable.

Limitations

This module was tested on Puppet 5.2.0 with latest Puppetserver 5.1.4.

Development

Feel free to create issues, PR and so on :)

puppet-notifier's People

Contributors

logicminds avatar

Watchers

James Cloos avatar

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.