|
|
@ -16,7 +16,8 @@
|
|
|
|
from __future__ import (absolute_import, division, print_function)
|
|
|
|
from __future__ import (absolute_import, division, print_function)
|
|
|
|
__metaclass__ = type
|
|
|
|
__metaclass__ = type
|
|
|
|
|
|
|
|
|
|
|
|
import os,sys,re,socket
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
|
|
HAS_XMPP = True
|
|
|
|
HAS_XMPP = True
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
import xmpp
|
|
|
|
import xmpp
|
|
|
@ -24,9 +25,8 @@ except ImportError:
|
|
|
|
HAS_XMPP = False
|
|
|
|
HAS_XMPP = False
|
|
|
|
|
|
|
|
|
|
|
|
from ansible.plugins.callback import CallbackBase
|
|
|
|
from ansible.plugins.callback import CallbackBase
|
|
|
|
from ansible import utils
|
|
|
|
|
|
|
|
from ansible.module_utils import basic
|
|
|
|
|
|
|
|
from ansible.utils.unicode import to_unicode, to_bytes
|
|
|
|
|
|
|
|
class CallbackModule(CallbackBase):
|
|
|
|
class CallbackModule(CallbackBase):
|
|
|
|
|
|
|
|
|
|
|
|
CALLBACK_VERSION = 2.0
|
|
|
|
CALLBACK_VERSION = 2.0
|
|
|
@ -39,8 +39,9 @@ class CallbackModule(CallbackBase):
|
|
|
|
super(CallbackModule, self).__init__(display=display)
|
|
|
|
super(CallbackModule, self).__init__(display=display)
|
|
|
|
|
|
|
|
|
|
|
|
if not HAS_XMPP:
|
|
|
|
if not HAS_XMPP:
|
|
|
|
print ("The required python xmpp library (xmpppy) is not installed"
|
|
|
|
self._display.warning("The required python xmpp library (xmpppy) is not installed."
|
|
|
|
" pip install git+https://github.com/ArchipelProject/xmpppy")
|
|
|
|
" pip install git+https://github.com/ArchipelProject/xmpppy")
|
|
|
|
|
|
|
|
self.disabled = True
|
|
|
|
|
|
|
|
|
|
|
|
self.serv = os.getenv('JABBER_SERV')
|
|
|
|
self.serv = os.getenv('JABBER_SERV')
|
|
|
|
self.j_user = os.getenv('JABBER_USER')
|
|
|
|
self.j_user = os.getenv('JABBER_USER')
|
|
|
@ -73,7 +74,6 @@ class CallbackModule(CallbackBase):
|
|
|
|
"""Display Playbook and play start messages"""
|
|
|
|
"""Display Playbook and play start messages"""
|
|
|
|
self.play = play
|
|
|
|
self.play = play
|
|
|
|
name = play.name
|
|
|
|
name = play.name
|
|
|
|
playbook = play.name
|
|
|
|
|
|
|
|
self.send_msg("Ansible starting play: %s" % (name))
|
|
|
|
self.send_msg("Ansible starting play: %s" % (name))
|
|
|
|
|
|
|
|
|
|
|
|
def playbook_on_stats(self, stats):
|
|
|
|
def playbook_on_stats(self, stats):
|
|
|
|