slack

Collection: community.general

Full Name: parallax.community.general.slack

Aliases: community.general.slack, slack

Synopsis

Send a message to a Slack channel

Parameters

NameTypeRequiredDefaultDescription
tokenstringyesSlack API token or webhook URL
msgstringyesMessage text to send
channelstring#generalChannel to post the message to
usernamestringAnsibleUsername to post as
icon_urlstringURL to an image to use as the icon
icon_emojistringEmoji to use as the icon (e.g. :robot_face:)
parsestringnoneParse mode for the message (none, full)
validate_certsbooltrueValidate SSL certificates
colorstringnormalColor of the message attachment bar
attachmentsstringJSON-formatted attachments for the message
thread_idstringThread timestamp to reply to

Example

- name: Announce the deploy in Slack
  slack:
    token: "{{ slack_token }}"
    msg: "Deployed {{ app_version }} to production"
    channel: "#deploys"
    color: good