mirror of
https://github.com/ansible/awx.git
synced 2026-03-11 14:39:30 -02:30
pycharm refactor rename files and class, linux rename tower_ controller_
This commit is contained in:
@@ -72,7 +72,7 @@ from ansible.errors import AnsibleParserError, AnsibleOptionsError
|
||||
from ansible.plugins.inventory import BaseInventoryPlugin
|
||||
from ansible.config.manager import ensure_type
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
|
||||
def handle_error(**kwargs):
|
||||
@@ -104,12 +104,12 @@ class InventoryModule(BaseInventoryPlugin):
|
||||
|
||||
# Defer processing of params to logic shared with the modules
|
||||
module_params = {}
|
||||
for plugin_param, module_param in TowerAPIModule.short_params.items():
|
||||
for plugin_param, module_param in ControllerAPIModule.short_params.items():
|
||||
opt_val = self.get_option(plugin_param)
|
||||
if opt_val is not None:
|
||||
module_params[module_param] = opt_val
|
||||
|
||||
module = TowerAPIModule(argument_spec={}, direct_params=module_params, error_callback=handle_error, warn_callback=self.warn_callback)
|
||||
module = ControllerAPIModule(argument_spec={}, direct_params=module_params, error_callback=handle_error, warn_callback=self.warn_callback)
|
||||
|
||||
# validate type of inventory_id because we allow two types as special case
|
||||
inventory_id = self.get_option('inventory_id')
|
||||
@@ -120,7 +120,7 @@ from ansible.plugins.lookup import LookupBase
|
||||
from ansible.errors import AnsibleError
|
||||
from ansible.module_utils._text import to_native
|
||||
from ansible.utils.display import Display
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
|
||||
class LookupModule(LookupBase):
|
||||
@@ -140,13 +140,13 @@ class LookupModule(LookupBase):
|
||||
|
||||
# Defer processing of params to logic shared with the modules
|
||||
module_params = {}
|
||||
for plugin_param, module_param in TowerAPIModule.short_params.items():
|
||||
for plugin_param, module_param in ControllerAPIModule.short_params.items():
|
||||
opt_val = self.get_option(plugin_param)
|
||||
if opt_val is not None:
|
||||
module_params[module_param] = opt_val
|
||||
|
||||
# Create our module
|
||||
module = TowerAPIModule(argument_spec={}, direct_params=module_params, error_callback=self.handle_error, warn_callback=self.warn_callback)
|
||||
module = ControllerAPIModule(argument_spec={}, direct_params=module_params, error_callback=self.handle_error, warn_callback=self.warn_callback)
|
||||
|
||||
response = module.get_endpoint(terms[0], data=self.get_option('query_params', {}))
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import, division, print_function
|
||||
|
||||
__metaclass__ = type
|
||||
|
||||
from .tower_module import TowerModule
|
||||
from .controller_module import ControllerModule
|
||||
from ansible.module_utils.basic import missing_required_lib
|
||||
|
||||
try:
|
||||
@@ -15,14 +15,14 @@ except ImportError:
|
||||
HAS_AWX_KIT = False
|
||||
|
||||
|
||||
class TowerAWXKitModule(TowerModule):
|
||||
class ControllerAWXKitModule(ControllerModule):
|
||||
connection = None
|
||||
apiV2Ref = None
|
||||
|
||||
def __init__(self, argument_spec, **kwargs):
|
||||
kwargs['supports_check_mode'] = False
|
||||
|
||||
super(TowerAWXKitModule, self).__init__(argument_spec=argument_spec, **kwargs)
|
||||
super(ControllerAWXKitModule, self).__init__(argument_spec=argument_spec, **kwargs)
|
||||
|
||||
# Die if we don't have AWX_KIT installed
|
||||
if not HAS_AWX_KIT:
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import, division, print_function
|
||||
|
||||
__metaclass__ = type
|
||||
|
||||
from .tower_module import TowerModule
|
||||
from .controller_module import ControllerModule
|
||||
from ansible.module_utils.urls import Request, SSLValidationError, ConnectionError
|
||||
from ansible.module_utils.six import PY2
|
||||
from ansible.module_utils.six.moves.urllib.error import HTTPError
|
||||
@@ -12,8 +12,8 @@ import time
|
||||
from json import loads, dumps
|
||||
|
||||
|
||||
class TowerAPIModule(TowerModule):
|
||||
# TODO: Move the collection version check into tower_module.py
|
||||
class ControllerAPIModule(ControllerModule):
|
||||
# TODO: Move the collection version check into controller_module.py
|
||||
# This gets set by the make process so whatever is in here is irrelevant
|
||||
_COLLECTION_VERSION = "0.0.1-devel"
|
||||
_COLLECTION_TYPE = "awx"
|
||||
@@ -30,7 +30,7 @@ class TowerAPIModule(TowerModule):
|
||||
def __init__(self, argument_spec, direct_params=None, error_callback=None, warn_callback=None, **kwargs):
|
||||
kwargs['supports_check_mode'] = True
|
||||
|
||||
super(TowerAPIModule, self).__init__(
|
||||
super(ControllerAPIModule, self).__init__(
|
||||
argument_spec=argument_spec, direct_params=direct_params, error_callback=error_callback, warn_callback=warn_callback, **kwargs
|
||||
)
|
||||
self.session = Request(cookies=CookieJar(), validate_certs=self.verify_ssl)
|
||||
@@ -47,14 +47,14 @@ class TowerAPIModule(TowerModule):
|
||||
|
||||
@staticmethod
|
||||
def get_name_field_from_endpoint(endpoint):
|
||||
return TowerAPIModule.IDENTITY_FIELDS.get(endpoint, 'name')
|
||||
return ControllerAPIModule.IDENTITY_FIELDS.get(endpoint, 'name')
|
||||
|
||||
def get_item_name(self, item, allow_unknown=False):
|
||||
if item:
|
||||
if 'name' in item:
|
||||
return item['name']
|
||||
|
||||
for field_name in TowerAPIModule.IDENTITY_FIELDS.values():
|
||||
for field_name in ControllerAPIModule.IDENTITY_FIELDS.values():
|
||||
if field_name in item:
|
||||
return item[field_name]
|
||||
|
||||
@@ -544,13 +544,13 @@ class TowerAPIModule(TowerModule):
|
||||
"""
|
||||
if isinstance(obj, dict):
|
||||
for val in obj.values():
|
||||
if TowerAPIModule.has_encrypted_values(val):
|
||||
if ControllerAPIModule.has_encrypted_values(val):
|
||||
return True
|
||||
elif isinstance(obj, list):
|
||||
for val in obj:
|
||||
if TowerAPIModule.has_encrypted_values(val):
|
||||
if ControllerAPIModule.has_encrypted_values(val):
|
||||
return True
|
||||
elif obj == TowerAPIModule.ENCRYPTED_STRING:
|
||||
elif obj == ControllerAPIModule.ENCRYPTED_STRING:
|
||||
return True
|
||||
return False
|
||||
|
||||
@@ -565,11 +565,11 @@ class TowerAPIModule(TowerModule):
|
||||
if set(old_field.keys()) != set(new_field.keys()):
|
||||
return False
|
||||
for key in new_field.keys():
|
||||
if not TowerAPIModule.fields_could_be_same(old_field[key], new_field[key]):
|
||||
if not ControllerAPIModule.fields_could_be_same(old_field[key], new_field[key]):
|
||||
return False
|
||||
return True # all sub-fields are either equal or could be equal
|
||||
else:
|
||||
if old_field == TowerAPIModule.ENCRYPTED_STRING:
|
||||
if old_field == ControllerAPIModule.ENCRYPTED_STRING:
|
||||
return True
|
||||
return bool(new_field == old_field)
|
||||
|
||||
@@ -29,7 +29,7 @@ class ItemNotDefined(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class TowerModule(AnsibleModule):
|
||||
class ControllerModule(AnsibleModule):
|
||||
url = None
|
||||
AUTH_ARGSPEC = dict(
|
||||
tower_host=dict(required=False, fallback=(env_fallback, ['TOWER_HOST'])),
|
||||
@@ -60,7 +60,7 @@ class TowerModule(AnsibleModule):
|
||||
|
||||
def __init__(self, argument_spec=None, direct_params=None, error_callback=None, warn_callback=None, **kwargs):
|
||||
full_argspec = {}
|
||||
full_argspec.update(TowerModule.AUTH_ARGSPEC)
|
||||
full_argspec.update(ControllerModule.AUTH_ARGSPEC)
|
||||
full_argspec.update(argument_spec)
|
||||
kwargs['supports_check_mode'] = True
|
||||
|
||||
@@ -72,7 +72,7 @@ class TowerModule(AnsibleModule):
|
||||
if direct_params is not None:
|
||||
self.params = direct_params
|
||||
else:
|
||||
super(TowerModule, self).__init__(argument_spec=full_argspec, **kwargs)
|
||||
super(ControllerModule, self).__init__(argument_spec=full_argspec, **kwargs)
|
||||
|
||||
self.load_config_files()
|
||||
|
||||
@@ -242,15 +242,15 @@ class TowerModule(AnsibleModule):
|
||||
if self.error_callback:
|
||||
self.error_callback(**kwargs)
|
||||
else:
|
||||
super(TowerModule, self).fail_json(**kwargs)
|
||||
super(ControllerModule, self).fail_json(**kwargs)
|
||||
|
||||
def exit_json(self, **kwargs):
|
||||
# Try to log out if we are authenticated
|
||||
self.logout()
|
||||
super(TowerModule, self).exit_json(**kwargs)
|
||||
super(ControllerModule, self).exit_json(**kwargs)
|
||||
|
||||
def warn(self, warning):
|
||||
if self.warn_callback is not None:
|
||||
self.warn_callback(warning)
|
||||
else:
|
||||
super(TowerModule, self).warn(warning)
|
||||
super(ControllerModule, self).warn(warning)
|
||||
@@ -111,7 +111,7 @@ status:
|
||||
sample: pending
|
||||
'''
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
|
||||
def main():
|
||||
@@ -135,7 +135,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
inventory = module.params.get('inventory')
|
||||
@@ -62,7 +62,7 @@ id:
|
||||
|
||||
import time
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
|
||||
def main():
|
||||
@@ -75,7 +75,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
command_id = module.params.get('command_id')
|
||||
@@ -82,7 +82,7 @@ status:
|
||||
'''
|
||||
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
|
||||
def main():
|
||||
@@ -94,7 +94,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
command_id = module.params.get('command_id')
|
||||
@@ -91,7 +91,7 @@ EXAMPLES = '''
|
||||
|
||||
import time
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
|
||||
def main():
|
||||
@@ -108,7 +108,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
name = module.params.get('name')
|
||||
@@ -289,7 +289,7 @@ EXAMPLES = '''
|
||||
organization: Foo
|
||||
'''
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
KIND_CHOICES = {
|
||||
'aws': 'Amazon Web Services',
|
||||
@@ -378,7 +378,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec, required_one_of=[['kind', 'credential_type']])
|
||||
module = ControllerAPIModule(argument_spec=argument_spec, required_one_of=[['kind', 'credential_type']])
|
||||
|
||||
# Extract our parameters
|
||||
name = module.params.get('name')
|
||||
@@ -69,7 +69,7 @@ EXAMPLES = '''
|
||||
|
||||
'''
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
|
||||
def main():
|
||||
@@ -84,7 +84,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
description = module.params.get('description')
|
||||
@@ -80,7 +80,7 @@ EXAMPLES = '''
|
||||
RETURN = ''' # '''
|
||||
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
KIND_CHOICES = {'ssh': 'Machine', 'vault': 'Ansible Vault', 'net': 'Network', 'scm': 'Source Control', 'cloud': 'Lots of others', 'insights': 'Insights'}
|
||||
|
||||
@@ -97,7 +97,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
name = module.params.get('name')
|
||||
@@ -67,7 +67,7 @@ EXAMPLES = '''
|
||||
'''
|
||||
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
import json
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
name = module.params.get('name')
|
||||
@@ -99,7 +99,7 @@ EXAMPLES = '''
|
||||
from os import environ
|
||||
import logging
|
||||
from ansible.module_utils.six.moves import StringIO
|
||||
from ..module_utils.tower_awxkit import TowerAWXKitModule
|
||||
from ..module_utils.awxkit import ControllerAWXKitModule
|
||||
|
||||
try:
|
||||
from awxkit.api.pages.api import EXPORTABLE_RESOURCES
|
||||
@@ -114,12 +114,12 @@ def main():
|
||||
all=dict(type='bool', default=False),
|
||||
)
|
||||
|
||||
# We are not going to raise an error here because the __init__ method of TowerAWXKitModule will do that for us
|
||||
# We are not going to raise an error here because the __init__ method of ControllerAWXKitModule will do that for us
|
||||
if HAS_EXPORTABLE_RESOURCES:
|
||||
for resource in EXPORTABLE_RESOURCES:
|
||||
argument_spec[resource] = dict(type='str')
|
||||
|
||||
module = TowerAWXKitModule(argument_spec=argument_spec)
|
||||
module = ControllerAWXKitModule(argument_spec=argument_spec)
|
||||
|
||||
if not HAS_EXPORTABLE_RESOURCES:
|
||||
module.fail_json(msg="Your version of awxkit does not have import/export")
|
||||
@@ -99,7 +99,7 @@ EXAMPLES = '''
|
||||
preserve_existing_children: True
|
||||
'''
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
import json
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
name = module.params.get('name')
|
||||
@@ -71,7 +71,7 @@ EXAMPLES = '''
|
||||
'''
|
||||
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
import json
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
name = module.params.get('name')
|
||||
@@ -48,7 +48,7 @@ EXAMPLES = '''
|
||||
assets: "{{ lookup('file', 'org.json') | from_json() }}"
|
||||
'''
|
||||
|
||||
from ..module_utils.tower_awxkit import TowerAWXKitModule
|
||||
from ..module_utils.awxkit import ControllerAWXKitModule
|
||||
|
||||
# These two lines are not needed if awxkit changes to do programatic notifications on issues
|
||||
from ansible.module_utils.six.moves import StringIO
|
||||
@@ -66,7 +66,7 @@ except ImportError:
|
||||
def main():
|
||||
argument_spec = dict(assets=dict(type='dict', required=True))
|
||||
|
||||
module = TowerAWXKitModule(argument_spec=argument_spec, supports_check_mode=False)
|
||||
module = ControllerAWXKitModule(argument_spec=argument_spec, supports_check_mode=False)
|
||||
|
||||
assets = module.params.get('assets')
|
||||
|
||||
@@ -80,7 +80,7 @@ extends_documentation_fragment: awx.awx.auth
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
|
||||
def main():
|
||||
@@ -99,7 +99,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
name = module.params.get('name')
|
||||
@@ -95,7 +95,7 @@ EXAMPLES = '''
|
||||
'''
|
||||
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
import json
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
name = module.params.get('name')
|
||||
@@ -150,7 +150,7 @@ EXAMPLES = '''
|
||||
private: false
|
||||
'''
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
from json import dumps
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
name = module.params.get('name')
|
||||
@@ -83,7 +83,7 @@ status:
|
||||
sample: pending
|
||||
'''
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
|
||||
def main():
|
||||
@@ -98,7 +98,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
name = module.params.get('name')
|
||||
@@ -49,7 +49,7 @@ id:
|
||||
'''
|
||||
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
|
||||
def main():
|
||||
@@ -60,7 +60,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
job_id = module.params.get('job_id')
|
||||
@@ -145,7 +145,7 @@ status:
|
||||
sample: pending
|
||||
'''
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
|
||||
def main():
|
||||
@@ -171,7 +171,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
optional_args = {}
|
||||
# Extract our parameters
|
||||
@@ -79,7 +79,7 @@ results:
|
||||
'''
|
||||
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
|
||||
def main():
|
||||
@@ -92,7 +92,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(
|
||||
module = ControllerAPIModule(
|
||||
argument_spec=argument_spec,
|
||||
mutually_exclusive=[
|
||||
('page', 'all_pages'),
|
||||
@@ -343,7 +343,7 @@ EXAMPLES = '''
|
||||
state: "present"
|
||||
'''
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
import json
|
||||
|
||||
|
||||
@@ -417,7 +417,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
name = module.params.get('name')
|
||||
@@ -97,7 +97,7 @@ status:
|
||||
'''
|
||||
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
|
||||
def main():
|
||||
@@ -112,7 +112,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
job_id = module.params.get('job_id')
|
||||
@@ -53,7 +53,7 @@ EXAMPLES = '''
|
||||
organization: My Organization
|
||||
'''
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
|
||||
def main():
|
||||
@@ -66,7 +66,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
name = module.params.get('name')
|
||||
@@ -44,12 +44,12 @@ EXAMPLES = '''
|
||||
'''
|
||||
|
||||
import base64
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
module = TowerAPIModule(
|
||||
module = ControllerAPIModule(
|
||||
argument_spec=dict(
|
||||
manifest=dict(type='str', required=True),
|
||||
force=dict(type='bool', required=False),
|
||||
@@ -61,11 +61,11 @@ EXAMPLES = '''
|
||||
'''
|
||||
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
|
||||
def main():
|
||||
module = TowerAPIModule(argument_spec={})
|
||||
module = ControllerAPIModule(argument_spec={})
|
||||
namespace = {'awx': 'awx', 'tower': 'ansible'}.get(module._COLLECTION_TYPE, 'unknown')
|
||||
namespace_name = '{0}.{1}'.format(namespace, module._COLLECTION_TYPE)
|
||||
module.exit_json(prefix=namespace_name, name=module._COLLECTION_TYPE, namespace=namespace, version=module._COLLECTION_VERSION)
|
||||
@@ -313,7 +313,7 @@ EXAMPLES = '''
|
||||
RETURN = ''' # '''
|
||||
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
OLD_INPUT_NAMES = (
|
||||
'username',
|
||||
@@ -384,7 +384,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
name = module.params.get('name')
|
||||
@@ -109,7 +109,7 @@ EXAMPLES = '''
|
||||
tower_config_file: "~/tower_cli.cfg"
|
||||
'''
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
|
||||
def main():
|
||||
@@ -130,7 +130,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
name = module.params.get('name')
|
||||
@@ -199,7 +199,7 @@ EXAMPLES = '''
|
||||
|
||||
import time
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
|
||||
def wait_for_project_update(module, last_request):
|
||||
@@ -280,7 +280,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
name = module.params.get('name')
|
||||
@@ -77,7 +77,7 @@ EXAMPLES = '''
|
||||
wait: False
|
||||
'''
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
import json
|
||||
import time
|
||||
|
||||
@@ -93,7 +93,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
name = module.params.get('name')
|
||||
@@ -148,7 +148,7 @@ EXAMPLES = '''
|
||||
state: present
|
||||
'''
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
|
||||
def main():
|
||||
@@ -194,7 +194,7 @@ def main():
|
||||
state=dict(choices=['present', 'absent'], default='present'),
|
||||
)
|
||||
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
role_type = module.params.pop('role')
|
||||
role_field = role_type + '_role'
|
||||
@@ -135,7 +135,7 @@ EXAMPLES = '''
|
||||
register: result
|
||||
'''
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
|
||||
def main():
|
||||
@@ -160,7 +160,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
rrule = module.params.get('rrule')
|
||||
@@ -69,7 +69,7 @@ EXAMPLES = '''
|
||||
last_name: "surname"
|
||||
'''
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
try:
|
||||
import yaml
|
||||
@@ -107,7 +107,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(
|
||||
module = ControllerAPIModule(
|
||||
argument_spec=argument_spec,
|
||||
required_one_of=[['name', 'settings']],
|
||||
mutually_exclusive=[['name', 'settings']],
|
||||
@@ -59,7 +59,7 @@ EXAMPLES = '''
|
||||
tower_config_file: "~/tower_cli.cfg"
|
||||
'''
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
|
||||
def main():
|
||||
@@ -73,7 +73,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
name = module.params.get('name')
|
||||
@@ -116,7 +116,7 @@ tower_token:
|
||||
returned: on successful create
|
||||
'''
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
|
||||
def return_token(module, last_response):
|
||||
@@ -142,7 +142,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(
|
||||
module = ControllerAPIModule(
|
||||
argument_spec=argument_spec,
|
||||
mutually_exclusive=[
|
||||
('existing_token', 'existing_token_id'),
|
||||
@@ -107,7 +107,7 @@ EXAMPLES = '''
|
||||
tower_config_file: "~/tower_cli.cfg"
|
||||
'''
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
|
||||
def main():
|
||||
@@ -125,7 +125,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
username = module.params.get('username')
|
||||
@@ -77,7 +77,7 @@ RETURN = """
|
||||
"""
|
||||
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
|
||||
def main():
|
||||
@@ -91,7 +91,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
workflow_job_id = module.params.get("workflow_job_id")
|
||||
@@ -455,7 +455,7 @@ EXAMPLES = '''
|
||||
|
||||
'''
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
import json
|
||||
|
||||
@@ -689,7 +689,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
name = module.params.get('name')
|
||||
@@ -224,7 +224,7 @@ EXAMPLES = '''
|
||||
- my-third-node
|
||||
'''
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
|
||||
def main():
|
||||
@@ -259,7 +259,7 @@ def main():
|
||||
]
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(
|
||||
module = ControllerAPIModule(
|
||||
argument_spec=argument_spec,
|
||||
mutually_exclusive=mutually_exclusive,
|
||||
required_if=required_if,
|
||||
@@ -90,7 +90,7 @@ EXAMPLES = '''
|
||||
wait: False
|
||||
'''
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
import json
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
optional_args = {}
|
||||
# Extract our parameters
|
||||
@@ -69,7 +69,7 @@ RETURN = """
|
||||
"""
|
||||
|
||||
|
||||
from ..module_utils.tower_api import TowerAPIModule
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
import time
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ def main():
|
||||
)
|
||||
|
||||
# Create a module for ourselves
|
||||
module = TowerAPIModule(argument_spec=argument_spec)
|
||||
module = ControllerAPIModule(argument_spec=argument_spec)
|
||||
|
||||
# Extract our parameters
|
||||
workflow_job_id = module.params.get("workflow_job_id")
|
||||
Reference in New Issue
Block a user