Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/notification/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/notification/mattermost.pyc

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
d
�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�
module: mattermost
short_description: Send Mattermost notifications
description:
    - Sends notifications to U(http://your.mattermost.url) via the Incoming WebHook integration.
version_added: "2.3"
author: "Benjamin Jolivot (@bjolivot)"
options:
  url:
    description:
      - Mattermost url (i.e. http://mattermost.yourcompany.com).
    required: true
  api_key:
    description:
      - Mattermost webhook api key. Log into your mattermost site, go to
        Menu -> Integration -> Incoming Webhook -> Add Incoming Webhook.
        This will give you full URL. api_key is the last part.
        http://mattermost.example.com/hooks/C(API_KEY)
    required: true
  text:
    description:
      - Text to send. Note that the module does not handle escaping characters.
    required: true
  channel:
    description:
      - Channel to send the message to. If absent, the message goes to the channel selected for the I(api_key).
  username:
    description:
      - This is the sender of the message (Username Override need to be enabled by mattermost admin, see mattermost doc.
    default: Ansible
  icon_url:
    description:
      - Url for the message sender's icon.
    default: https://www.ansible.com/favicon.ico
  validate_certs:
    description:
      - If C(no), SSL certificates will not be validated. This should only be used
        on personally controlled sites using self-signed certificates.
    default: yes
    type: bool
s�
- name: Send notification message via Mattermost
  mattermost:
    url: http://mattermost.example.com
    api_key: my_api_key
    text: '{{ inventory_hostname }} completed'

- name: Send notification message via Mattermost all options
  mattermost:
    url: http://mattermost.example.com
    api_key: my_api_key
    text: '{{ inventory_hostname }} completed'
    channel: notifications
    username: 'Ansible on {{ inventory_hostname }}'
    icon_url: http://www.example.com/some-image-file.png
s�
payload:
    description: Mattermost payload
    returned: success
    type: str
webhook_url:
    description: URL the webhook is sent to
    returned: success
    type: str
(t
AnsibleModule(t	fetch_urlcC`s�tdtdtdtdddt�dtdddtdt�d	tdddt�d
tdddd�dtdddd
�dtdddd�dtdddd���}tdtdd�}dj|jd|jd�}||d<i}xAd	d
ddgD]-}|j|dk	r	|j|||<q	q	W|j|�}||d<idd6dd6}|jtkr�t	d|d|d|ddd |�\}}|d!d"kr�d#j|d�|d<|j
|�q�n|j|�dS($Ntsupports_check_modet
argument_specturlttypetstrtrequiredtapi_keytno_logttexttchanneltdefaulttusernametAnsibleticon_urls#https://www.ansible.com/favicon.icotvalidate_certstyestbooltchangedtmsgtOKs
{0}/hooks/{1}twebhook_urltpayloadsapplication/jsonsContent-TypetAccepttmoduletheaderstmethodtPOSTtdataRi�s5Failed to send mattermost message, the error was: {0}(RtTruetdicttNonetFalsetformattparamstjsonifyt
check_modeR	t	fail_jsont	exit_json(R!tresultRRtparamR"tresponsetinfo((sK/usr/lib/python2.7/site-packages/ansible/modules/notification/mattermost.pytmain`s8 


	-t__main__N(t
__future__RRRR
t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRtansible.module_utils.urlsR	R4t__name__(((sK/usr/lib/python2.7/site-packages/ansible/modules/notification/mattermost.pyt<module>
s


+	6

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]