community.general.mattermost – Send Mattermost notifications
Note
This plugin is part of the community.general collection (version 3.8.3).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.mattermost
.
Synopsis
Sends notifications to http://your.mattermost.url via the Incoming WebHook integration.
Parameters
Parameter |
Comments |
---|---|
Mattermost webhook api key. Log into your mattermost site, go to Menu -> Integration -> Incoming Webhook -> Add Incoming Webhook. This will give you full URL. api_key is the last part. http://mattermost.example.com/hooks/ |
|
Channel to send the message to. If absent, the message goes to the channel selected for the api_key. |
|
Url for the message sender’s icon. Default: “https://www.ansible.com/favicon.ico” |
|
Text to send. Note that the module does not handle escaping characters. |
|
Mattermost url (i.e. http://mattermost.yourcompany.com). |
|
This is the sender of the message (Username Override need to be enabled by mattermost admin, see mattermost doc. Default: “Ansible” |
|
If Choices:
|
Examples
- name: Send notification message via Mattermost
community.general.mattermost:
url: http://mattermost.example.com
api_key: my_api_key
text: '{{ inventory_hostname }} completed'
- name: Send notification message via Mattermost all options
community.general.mattermost:
url: http://mattermost.example.com
api_key: my_api_key
text: '{{ inventory_hostname }} completed'
channel: notifications
username: 'Ansible on {{ inventory_hostname }}'
icon_url: http://www.example.com/some-image-file.png
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Mattermost payload Returned: success |
|
URL the webhook is sent to Returned: success |
Authors
Benjamin Jolivot (@bjolivot)