Version information
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
- ,
Start using this module
Add this module to your Puppetfile:
mod 'udzura-report_slack2', '0.3.1'
Learn more about managing modules with a PuppetfileDocumentation
puppet-report_slack2
Yet another slack report processor.
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.
The MIT License (MIT) Copyright © 2015 Uchio KONDO Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.