|
|
@ -55,6 +55,16 @@ from ansible.utils.plugin_docs import get_versioned_doclink
|
|
|
|
display = Display()
|
|
|
|
display = Display()
|
|
|
|
urlparse = six.moves.urllib.parse.urlparse
|
|
|
|
urlparse = six.moves.urllib.parse.urlparse
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SERVER_DEF = [
|
|
|
|
|
|
|
|
('url', True),
|
|
|
|
|
|
|
|
('username', False),
|
|
|
|
|
|
|
|
('password', False),
|
|
|
|
|
|
|
|
('token', False),
|
|
|
|
|
|
|
|
('auth_url', False),
|
|
|
|
|
|
|
|
('v3', False),
|
|
|
|
|
|
|
|
('validate_certs', False)
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def with_collection_artifacts_manager(wrapped_method):
|
|
|
|
def with_collection_artifacts_manager(wrapped_method):
|
|
|
|
"""Inject an artifacts manager if not passed explicitly.
|
|
|
|
"""Inject an artifacts manager if not passed explicitly.
|
|
|
@ -466,11 +476,9 @@ class GalaxyCLI(CLI):
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'required': required,
|
|
|
|
'required': required,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
server_def = [('url', True), ('username', False), ('password', False), ('token', False),
|
|
|
|
|
|
|
|
('auth_url', False), ('v3', False)]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
validate_certs = not context.CLIARGS['ignore_certs']
|
|
|
|
validate_certs_fallback = not context.CLIARGS['ignore_certs']
|
|
|
|
galaxy_options = {'validate_certs': validate_certs}
|
|
|
|
galaxy_options = {}
|
|
|
|
for optional_key in ['clear_response_cache', 'no_cache']:
|
|
|
|
for optional_key in ['clear_response_cache', 'no_cache']:
|
|
|
|
if optional_key in context.CLIARGS:
|
|
|
|
if optional_key in context.CLIARGS:
|
|
|
|
galaxy_options[optional_key] = context.CLIARGS[optional_key]
|
|
|
|
galaxy_options[optional_key] = context.CLIARGS[optional_key]
|
|
|
@ -482,7 +490,7 @@ class GalaxyCLI(CLI):
|
|
|
|
for server_priority, server_key in enumerate(server_list, start=1):
|
|
|
|
for server_priority, server_key in enumerate(server_list, start=1):
|
|
|
|
# Config definitions are looked up dynamically based on the C.GALAXY_SERVER_LIST entry. We look up the
|
|
|
|
# Config definitions are looked up dynamically based on the C.GALAXY_SERVER_LIST entry. We look up the
|
|
|
|
# section [galaxy_server.<server>] for the values url, username, password, and token.
|
|
|
|
# section [galaxy_server.<server>] for the values url, username, password, and token.
|
|
|
|
config_dict = dict((k, server_config_def(server_key, k, req)) for k, req in server_def)
|
|
|
|
config_dict = dict((k, server_config_def(server_key, k, req)) for k, req in SERVER_DEF)
|
|
|
|
defs = AnsibleLoader(yaml_dump(config_dict)).get_single_data()
|
|
|
|
defs = AnsibleLoader(yaml_dump(config_dict)).get_single_data()
|
|
|
|
C.config.initialize_plugin_configuration_definitions('galaxy_server', server_key, defs)
|
|
|
|
C.config.initialize_plugin_configuration_definitions('galaxy_server', server_key, defs)
|
|
|
|
|
|
|
|
|
|
|
@ -494,6 +502,10 @@ class GalaxyCLI(CLI):
|
|
|
|
username = server_options['username']
|
|
|
|
username = server_options['username']
|
|
|
|
available_api_versions = None
|
|
|
|
available_api_versions = None
|
|
|
|
v3 = server_options.pop('v3', None)
|
|
|
|
v3 = server_options.pop('v3', None)
|
|
|
|
|
|
|
|
validate_certs = server_options['validate_certs']
|
|
|
|
|
|
|
|
if validate_certs is None:
|
|
|
|
|
|
|
|
validate_certs = validate_certs_fallback
|
|
|
|
|
|
|
|
server_options['validate_certs'] = validate_certs
|
|
|
|
if v3:
|
|
|
|
if v3:
|
|
|
|
# This allows a user to explicitly indicate the server uses the /v3 API
|
|
|
|
# This allows a user to explicitly indicate the server uses the /v3 API
|
|
|
|
# This was added for testing against pulp_ansible and I'm not sure it has
|
|
|
|
# This was added for testing against pulp_ansible and I'm not sure it has
|
|
|
|