/puppet-report_slack2

Yet another slack report processor

Primary LanguageRubyMIT LicenseMIT

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:

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

file {
  '/etc/puppet/slack.yaml':
    content => inline_template("<%= YAML.dump(@slack) %>")
}

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

See also

License

MIT.