|
|
@ -42,6 +42,7 @@ In 2.0 things get a bit more complicated to start, but you end up with much more
|
|
|
|
#!/usr/bin/env python
|
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
|
|
|
|
import json
|
|
|
|
import json
|
|
|
|
|
|
|
|
import shutil
|
|
|
|
from collections import namedtuple
|
|
|
|
from collections import namedtuple
|
|
|
|
from ansible.parsing.dataloader import DataLoader
|
|
|
|
from ansible.parsing.dataloader import DataLoader
|
|
|
|
from ansible.vars.manager import VariableManager
|
|
|
|
from ansible.vars.manager import VariableManager
|
|
|
@ -49,6 +50,7 @@ In 2.0 things get a bit more complicated to start, but you end up with much more
|
|
|
|
from ansible.playbook.play import Play
|
|
|
|
from ansible.playbook.play import Play
|
|
|
|
from ansible.executor.task_queue_manager import TaskQueueManager
|
|
|
|
from ansible.executor.task_queue_manager import TaskQueueManager
|
|
|
|
from ansible.plugins.callback import CallbackBase
|
|
|
|
from ansible.plugins.callback import CallbackBase
|
|
|
|
|
|
|
|
import ansible.constants as C
|
|
|
|
|
|
|
|
|
|
|
|
class ResultCallback(CallbackBase):
|
|
|
|
class ResultCallback(CallbackBase):
|
|
|
|
"""A sample callback plugin used for performing an action as results come in
|
|
|
|
"""A sample callback plugin used for performing an action as results come in
|
|
|
@ -108,6 +110,9 @@ In 2.0 things get a bit more complicated to start, but you end up with much more
|
|
|
|
if tqm is not None:
|
|
|
|
if tqm is not None:
|
|
|
|
tqm.cleanup()
|
|
|
|
tqm.cleanup()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Remove ansible tmpdir
|
|
|
|
|
|
|
|
shutil.rmtree(C.DEFAULT_LOCAL_TMP, True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. _python_api_old:
|
|
|
|
.. _python_api_old:
|
|
|
|
|
|
|
|
|
|
|
|