updated the examples to the new Slack API

This commit is contained in:
Ramon de la Fuente 2015-10-08 12:59:21 +02:00
parent 8ffc11713f
commit d14bb33a03

View file

@ -117,15 +117,13 @@ EXAMPLES = """
- name: Send notification message via Slack - name: Send notification message via Slack
local_action: local_action:
module: slack module: slack
domain: future500.slack.com token: thetoken/generatedby/slack
token: thetokengeneratedbyslack
msg: "{{ inventory_hostname }} completed" msg: "{{ inventory_hostname }} completed"
- name: Send notification message via Slack all options - name: Send notification message via Slack all options
local_action: local_action:
module: slack module: slack
domain: future500.slack.com token: thetoken/generatedby/slack
token: thetokengeneratedbyslack
msg: "{{ inventory_hostname }} completed" msg: "{{ inventory_hostname }} completed"
channel: "#ansible" channel: "#ansible"
username: "Ansible on {{ inventory_hostname }}" username: "Ansible on {{ inventory_hostname }}"
@ -135,8 +133,7 @@ EXAMPLES = """
- name: insert a color bar in front of the message for visibility purposes and use the default webhook icon and name configured in Slack - name: insert a color bar in front of the message for visibility purposes and use the default webhook icon and name configured in Slack
slack: slack:
domain: future500.slack.com token: thetoken/generatedby/slack
token: thetokengeneratedbyslack
msg: "{{ inventory_hostname }} is alive!" msg: "{{ inventory_hostname }} is alive!"
color: good color: good
username: "" username: ""
@ -144,8 +141,7 @@ EXAMPLES = """
- name: Use the attachments API - name: Use the attachments API
slack: slack:
domain: future500.slack.com token: thetoken/generatedby/slack
token: thetokengeneratedbyslack
attachments: attachments:
- text: "Display my system load on host A and B" - text: "Display my system load on host A and B"
color: "#ff00dd" color: "#ff00dd"
@ -157,6 +153,14 @@ EXAMPLES = """
- title: "System B" - title: "System B"
value: "load average: 5,16, 4,64, 2,43" value: "load average: 5,16, 4,64, 2,43"
short: "true" short: "true"
- name: Send notification message via Slack (deprecated API using domian)
local_action:
module: slack
domain: future500.slack.com
token: thetokengeneratedbyslack
msg: "{{ inventory_hostname }} completed"
""" """
OLD_SLACK_INCOMING_WEBHOOK = 'https://%s/services/hooks/incoming-webhook?token=%s' OLD_SLACK_INCOMING_WEBHOOK = 'https://%s/services/hooks/incoming-webhook?token=%s'