rocketchat – Send notifications to Rocket Chat¶
Synopsis¶
- The
rocketchat
module sends notifications to Rocket Chat via the Incoming WebHook integration
Parameters¶
Examples¶
- name: Send notification message via Rocket Chat
rocketchat:
token: thetoken/generatedby/rocketchat
domain: chat.example.com
msg: '{{ inventory_hostname }} completed'
delegate_to: localhost
- name: Send notification message via Rocket Chat all options
rocketchat:
domain: chat.example.com
token: thetoken/generatedby/rocketchat
msg: '{{ inventory_hostname }} completed'
channel: #ansible
username: 'Ansible on {{ inventory_hostname }}'
icon_url: http://www.example.com/some-image-file.png
link_names: 0
delegate_to: localhost
- name: insert a color bar in front of the message for visibility purposes and use the default webhook icon and name configured in rocketchat
rocketchat:
token: thetoken/generatedby/rocketchat
domain: chat.example.com
msg: '{{ inventory_hostname }} is alive!'
color: good
username: ''
icon_url: ''
delegate_to: localhost
- name: Use the attachments API
rocketchat:
token: thetoken/generatedby/rocketchat
domain: chat.example.com
attachments:
- text: Display my system load on host A and B
color: #ff00dd
title: System load
fields:
- title: System A
value: 'load average: 0,74, 0,66, 0,63'
short: True
- title: System B
value: 'load average: 5,16, 4,64, 2,43'
short: True
delegate_to: localhost
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
changed
boolean
|
success |
A flag indicating if any change was made or not.
|
Status¶
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]
Authors¶
- Ramon de la Fuente (@ramondelafuente)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.