report_slack2

pdk
Yet another slack report processor
Uchio Kondo

Uchio Kondo

udzura

17,935 downloads

267 latest version

4.0 quality score

Version information

  • 0.3.1 (latest)
  • 0.3.0
  • 0.2.4
  • 0.2.3
  • 0.2.2
  • 0.2.1
  • 0.2.0
  • 0.1.1
  • 0.1.0
released Nov 26th 2020
This version is compatible with:
  • Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2016.4.x
  • Puppet >= 4.10.0 < 7.0.0
  • Centos
    ,
    Ubuntu

Start using this module

Documentation

udzura/report_slack2 — version 0.3.1 Nov 26th 2020

puppet-report_slack2

Yet another slack report processor.

screen

Install && setup

Run:

puppet module install udzura-report_slack2
# or use librarian-puppet

Create config file /etc/puppet/slack.yaml as:

---
username: "puppet reporter"
webhook: "https://hooks.slack.com/services/YOUR/incoming-web-hook/AddRess!!!"
channels:
  - "#udzura_dev"
report_url: 'https://puppetdashboard.example.jp/reports'
http_proxy: 'http://proxy.example.com:3128' # Optionally specify an http proxy to use when posting to slack.

Puppet way, like this:


class { 'report_slack2' :
  username   => 'puppet reporter',
  webhook    => 'https://hooks.slack.com/services/YOUR/incoming-web-hook/AddRess!!!',
  channels   => [ "#udzura_dev" ],
  report_url => 'https://puppetdashboard.example.jp/reports',
}

Then set reporter:

[master]
...

report  = true
reports = store,slack

Reports URL

The reports URL can be left empty in the slack.yaml file for standalone setups and will appear in the Slack status message.

reports_url: ''

If a report URL is set to a non empty value it will be included in the Slac status message.

report_url: 'https://puppetdashboard.example.jp/reports'

The reports_url property also provides the ability to set interpolation of a hostname with self.host by using the %h sting within the reports_url value. In the example below %h will be replaced with ths hostname of provisioned host. To create a link directly to a focused reports section

reports_url: 'https://puppetdashboard.example.jp/%h/reports'

The above translates to something like https://puppetdashboard.example.jp/app001.example.jp/reports

Change what you want to notify

If you want to notify only failed status, you can set slack.yaml like the following:

statuses: 'failed'

or, you want to notify all statuses, set like the following:

statuses: 'changed,failed,unchanged'

See also

License

MIT.