salt.returners.slack_returner
Return salt data via slack
New in version 2015.5.0.
The following fields can be set in the minion conf file:
slack.channel (required) slack.api_key (required) slack.username (required) slack.as_user (required to see the profile picture of your bot) slack.profile (optional) slack.changes(optional, only show changes and failed states) slack.only_show_failed(optional, only show failed states) slack.yaml_format(optional, format the json in yaml format)
Alternative configuration values can be used by prefacing the configuration. Any values not found in the alternative configuration will be pulled from the default location:
slack.channel slack.api_key slack.username slack.as_user
Slack settings may also be configured as:
slack: channel: RoomName api_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx username: user as_user: true alternative.slack: room_id: RoomName api_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx from_name: [email protected] slack_profile: slack.api_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx slack.from_name: [email protected] slack: profile: slack_profile channel: RoomName alternative.slack: profile: slack_profile channel: RoomName
To use the Slack returner, append '--return slack' to the salt command.
salt '*' test.ping --return slack
To use the alternative configuration, append '--return_config alternative' to the salt command.
salt '*' test.ping --return slack --return_config alternative
To override individual configuration items, append --return_kwargs '{"key:": "value"}' to the salt command.
New in version 2016.3.0.
salt '*' test.ping --return slack --return_kwargs '{"channel": "#random"}'
-
Send an slack message with the data
salt.returners.slack_returner.returner(ret)
© 2021 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltproject.io/en/latest/ref/returners/all/salt.returners.slack_returner.html