diff --git a/lib/ansible/modules/notification/slack.py b/lib/ansible/modules/notification/slack.py index 7e036559cd0..df694da03c6 100644 --- a/lib/ansible/modules/notification/slack.py +++ b/lib/ansible/modules/notification/slack.py @@ -35,7 +35,7 @@ options: domain: description: - Slack (sub)domain for your environment without protocol. (i.e. - C(future500.slack.com)) In 1.8 and beyond, this is deprecated and may + C(example.slack.com)) In 1.8 and beyond, this is deprecated and may be ignored. See token documentation for information. required: false default: None @@ -120,14 +120,13 @@ options: EXAMPLES = """ - name: Send notification message via Slack - local_action: - module: slack + slack: token: thetoken/generatedby/slack msg: '{{ inventory_hostname }} completed' + delegate_to: localhost - name: Send notification message via Slack all options - local_action: - module: slack + slack: token: thetoken/generatedby/slack msg: '{{ inventory_hostname }} completed' channel: #ansible @@ -135,6 +134,7 @@ EXAMPLES = """ icon_url: http://www.example.com/some-image-file.png link_names: 0 parse: 'none' + 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 Slack slack: @@ -158,14 +158,6 @@ EXAMPLES = """ - title: System B value: 'load average: 5,16, 4,64, 2,43' short: True - -- name: Send notification message via Slack (deprecated API using domain) - local_action: - module: slack - domain: example.slack.com - token: thetokengeneratedbyslack - msg: '{{ inventory_hostname }} completed' - """ OLD_SLACK_INCOMING_WEBHOOK = 'https://%s/services/hooks/incoming-webhook?token=%s'