| Author: | Ramon de la Fuente <ramon@delafuente.nl> |
|---|
New in version 1.6.
The slack module sends notifications to http://slack.com via the Incoming WebHook integration
| parameter | required | default | choices | comments |
|---|---|---|---|---|
| channel | no | Channel to send the message to. If absent, the message goes to the channel selected for the token. | ||
| domain | yes | Slack (sub)domain for your environment without protocol. (i.e. future500.slack.com) |
||
| icon_emoji | no | Emoji for the message sender. See Slack documentation for options. (if icon_emoji is set, icon_url will not be used) | ||
| icon_url | no | Url for the message sender's icon (default http://www.ansible.com/favicon.ico) |
||
| link_names | no | 1 |
|
Automatically create links for channels and usernames in msg. |
| msg | yes | Message to send. | ||
| parse | no |
|
Setting for the message parser at Slack | |
| token | yes | Slack integration token | ||
| username | no | ansible | This is the sender of the message. | |
| validate_certs | no | yes |
|
If no, SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. |
- name: Send notification message via Slack
local_action:
module: slack
domain: future500.slack.com
token: thetokengeneratedbyslack
msg: "{{ inventory_hostname }} completed"
- name: Send notification message via Slack all options
local_action:
module: slack
domain: future500.slack.com
token: thetokengeneratedbyslack
msg: "{{ inventory_hostname }} completed"
channel: "#ansible"
username: "Ansible on {{ inventory_hostname }}"
icon_url: "http://www.example.com/some-image-file.png"
link_names: 0
parse: 'none'