Return salt data via mattermost
New in version 2017.7.0.
The following fields can be set in the minion conf file:: .. code-block:: yaml
mattermost.hook (required) mattermost.username (optional) mattermost.channel (optional)
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: .. code-block:: yaml
mattermost.channel mattermost.hook mattermost.username
mattermost settings may also be configured as: .. code-block:: yaml
- mattermost:
- channel: RoomName hook: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx username: user
To use the mattermost returner, append '--return mattermost' to the salt command. .. code-block:: bash
salt '*' test.ping --return mattermost
To override individual configuration items, append --return_kwargs '{'key:': 'value'}' to the salt command. .. code-block:: bash
salt '*' test.ping --return mattermost --return_kwargs '{'channel': '#random'}'
salt.returners.mattermost_returner.
event_return
(events)¶Send the events to a mattermost room. :param events: List of events :return: Boolean if messages were sent successfully.
salt.returners.mattermost_returner.
post_message
(channel, message, username, api_url, hook)¶Send a message to a mattermost room. :param channel: The room name. :param message: The message to send to the mattermost room. :param username: Specify who the message is from. :param hook: The mattermost hook, if not specified in the configuration. :return: Boolean if message was sent successfully.
salt.returners.mattermost_returner.
returner
(ret)¶Send an mattermost message with the data
Docs for previous releases are available on readthedocs.org.
Latest Salt release: 2017.7.1