Documentation

mattermost - Send Mattermost notifications

New in version 2.3.

Synopsis

Options

parameter required default choices comments
api_key
yes
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/API_KEY
channel
no
Channel to send the message to. If absent, the message goes to the channel selected for the api_key.
icon_url
no https://www.ansible.com/favicon.ico
Url for the message sender's icon.
text
yes
Text to send. Note that the module does not handle escaping characters.
url
yes
Mattermost url (i.e. http://mattermost.yourcompany.com).
username
no Ansible
This is the sender of the message (Username Override need to be enabled by mattermost admin, see mattermost doc.
validate_certs
no True
  • yes
  • no
If no, SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.

Examples

- name: Send notification message via Mattermost
  mattermost:
    url: http://mattermost.example.com
    api_key: my_api_key
    text: '{{ inventory_hostname }} completed'

- name: Send notification message via Mattermost all options
  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 Return Values, the following are the fields unique to this module:

name description returned type sample
webhook_url
URL the webhook is sent to
success string
payload
Mattermost payload
success string


Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.