�
�Udac @` s� d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d
Z y d d l
m Z m Z e
Z Wn e k
r� e Z n Xd d l m Z d d
l m Z d � Z d � Z d � Z d � Z e d k r� e � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont stableinterfacet statust communityt supported_bys�
module: bearychat
short_description: Send BearyChat notifications
description:
- The M(bearychat) module sends notifications to U(https://bearychat.com)
via the Incoming Robot integration.
version_added: "2.4"
author: "Jiangge Zhang (@tonyseek)"
options:
url:
description:
- BearyChat WebHook URL. This authenticates you to the bearychat
service. It looks like
C(https://hook.bearychat.com/=ae2CF/incoming/e61bd5c57b164e04b11ac02e66f47f60).
required: true
text:
description:
- Message to send.
markdown:
description:
- If C(yes), text will be parsed as markdown.
default: 'yes'
type: bool
channel:
description:
- Channel to send the message to. If absent, the message goes to the
default channel selected by the I(url).
attachments:
description:
- Define a list of attachments. For more information, see
https://github.com/bearyinnovative/bearychat-tutorial/blob/master/robots/incoming.md#attachments
s�
- name: Send notification message via BearyChat
local_action:
module: bearychat
url: |
https://hook.bearychat.com/=ae2CF/incoming/e61bd5c57b164e04b11ac02e66f47f60
text: "{{ inventory_hostname }} completed"
- name: Send notification message via BearyChat all options
local_action:
module: bearychat
url: |
https://hook.bearychat.com/=ae2CF/incoming/e61bd5c57b164e04b11ac02e66f47f60
text: "{{ inventory_hostname }} completed"
markdown: no
channel: "#ansible"
attachments:
- title: "Ansible on {{ inventory_hostname }}"
text: "May the Force be with you."
color: "#ffffff"
images:
- http://example.com/index.png
s]
msg:
description: execution result
returned: success
type: str
sample: "OK"
( t urlparset
urlunparse( t
AnsibleModule( t fetch_urlc ` s� i } | d k r | | d <n | d k r8 | | d <n | d k rQ | | d <n | d k r� | j d g � j � f d � | D� � n d � j | � } | S( Nt textt markdownt channelt attachmentsc 3` sK | ]A } t � | j d � | j d � | j d � | j d � � Vq d S( t titleR t colort imagesN( t&