"""
-Tool module to interact with the Ansible Runner Service
+Client module to interact with the Ansible Runner Service
"""
import requests
import json
import re
-# Ansible Runner events finished
-
-
# Ansible Runner service API endpoints
API_URL = "api"
LOGIN_URL = "api/v1/login"
# Params used in the playbook
self.params = the_params
- # Logger
self.log = logger
def launch(self):
""" Login with user credentials to obtain a valid token
"""
- response = None
-
the_url = "%s/%s" % (self.server_url, LOGIN_URL)
response = requests.get(the_url,
auth = self.auth,
The external Orchestrator is the Ansible runner service (RESTful https service)
"""
-# Python stuff
-from threading import Event
-import errno
import json
-# Ceph stuff
from mgr_module import MgrModule
import orchestrator
-# Orchestrator stuff
-# A Client is used to communicate with the Ansible Runner service
-from ansible_runner_svc import Client, PlayBookExecution, ExecutionStatusCode,\
+from .ansible_runner_svc import Client, PlayBookExecution, ExecutionStatusCode,\
EVENT_DATA_URL
-# Constants section
-
# Time to clean the completions list
WAIT_PERIOD = 10
]
def __init__(self, *args, **kwargs):
- """
- """
super(Module, self).__init__(*args, **kwargs)
self.run = False