�
�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 d
l Z d d
l
Z
e Z d
Z y d d
l Z Wn# e k
r� e
j � Z e Z n Xd d l m Z m Z d d l m 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_bysI
---
version_added: "1.2"
module: jabber
short_description: Send a message to jabber user or chat room
description:
- Send a message to jabber
options:
user:
description:
- User as which to connect
required: true
password:
description:
- password for user to connect
required: true
to:
description:
- user ID or name of the room, when using room use a slash to indicate your nick.
required: true
msg:
description:
- The message body.
required: true
host:
description:
- host to connect, overrides user info
port:
description:
- port to connect to, overrides default
default: 5222
encoding:
description:
- message encoding
# informational: requirements for nodes
requirements:
- python xmpp (xmpppy)
author: "Brian Coca (@bcoca)"
s
# send a message to a user
- jabber:
user: [email protected]
password: secret
to: [email protected]
msg: Ansible task finished
# send a message to a room
- jabber:
user: [email protected]
password: secret
to: [email protected]/ansiblebot
msg: Ansible task finished
# send a message, specifying the host and port
- jabber:
user: [email protected]
host: talk.example.net
port: 5223
password: secret
to: [email protected]
msg: Ansible task finished
N( t
AnsibleModulet missing_required_lib( t to_nativec
C` sd t d t d t d t � d t d t d t � d t d t � d t d t � d t d t � d t d t d
d d d
� d t d t � � d t � } t s� | j d t d � d t � n t j | j
d � } | j � } | j � } | j
d } | j
d } y# | j
d j
d d � \ } } Wn% t k
rJ| j
d d } } n X| j
d rh| j
d } n | } | j
d r�| j
d t j _ n t j j d | j
d � } yOt j | d g �}
|
j d | | f � s�| j d d d d | � n |
j | | d � s2| j d d d d | | f � n |
j d d � | r�| j d � | j d d d �t j d | j
d � } | j d d d! �|
j | � t j d � n
| j d"