Do not require ironic_url if cloud or auth.endpoint is provided
The endpoint may be specified in clouds.yaml or via auth, do not force ironic_url in either of these cases. Finally, accept "none" as a valid no-auth plugin name. Change-Id: I4d50b7c55727f022d79df85fb4a163fe3e5fca7b
This commit is contained in:
parent
284d7871ce
commit
8731fcc64b
@ -102,15 +102,21 @@ def main():
|
|||||||
module = AnsibleModule(argument_spec, **module_kwargs)
|
module = AnsibleModule(argument_spec, **module_kwargs)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
module.params['auth_type'] in [None, 'None']
|
module.params['auth_type'] in [None, 'None', 'none']
|
||||||
and module.params['ironic_url'] is None
|
and module.params['ironic_url'] is None
|
||||||
|
and not module.params['cloud']
|
||||||
|
and not (module.params['auth']
|
||||||
|
and module.params['auth'].get('endpoint'))
|
||||||
):
|
):
|
||||||
module.fail_json(msg="Authentication appears to be disabled, "
|
module.fail_json(msg="Authentication appears to be disabled, "
|
||||||
"Please define an ironic_url parameter")
|
"Please define either ironic_url, or cloud, "
|
||||||
|
"or auth.endpoint")
|
||||||
|
|
||||||
if (
|
if (
|
||||||
module.params['ironic_url']
|
module.params['ironic_url']
|
||||||
and module.params['auth_type'] in [None, 'None']
|
and module.params['auth_type'] in [None, 'None', 'none']
|
||||||
|
and not (module.params['auth']
|
||||||
|
and module.params['auth'].get('endpoint'))
|
||||||
):
|
):
|
||||||
module.params['auth'] = dict(
|
module.params['auth'] = dict(
|
||||||
endpoint=module.params['ironic_url']
|
endpoint=module.params['ironic_url']
|
||||||
|
@ -248,15 +248,21 @@ def main():
|
|||||||
if not HAS_JSONPATCH:
|
if not HAS_JSONPATCH:
|
||||||
module.fail_json(msg='jsonpatch is required for this module')
|
module.fail_json(msg='jsonpatch is required for this module')
|
||||||
if (
|
if (
|
||||||
module.params['auth_type'] in [None, 'None']
|
module.params['auth_type'] in [None, 'None', 'none']
|
||||||
and module.params['ironic_url'] is None
|
and module.params['ironic_url'] is None
|
||||||
|
and not module.params['cloud']
|
||||||
|
and not (module.params['auth']
|
||||||
|
and module.params['auth'].get('endpoint'))
|
||||||
):
|
):
|
||||||
module.fail_json(msg="Authentication appears to be disabled, "
|
module.fail_json(msg="Authentication appears to be disabled, "
|
||||||
"Please define an ironic_url parameter")
|
"Please define either ironic_url, or cloud, "
|
||||||
|
"or auth.endpoint")
|
||||||
|
|
||||||
if (
|
if (
|
||||||
module.params['ironic_url']
|
module.params['ironic_url']
|
||||||
and module.params['auth_type'] in [None, 'None']
|
and module.params['auth_type'] in [None, 'None', 'none']
|
||||||
|
and not (module.params['auth']
|
||||||
|
and module.params['auth'].get('endpoint'))
|
||||||
):
|
):
|
||||||
module.params['auth'] = dict(
|
module.params['auth'] = dict(
|
||||||
endpoint=module.params['ironic_url']
|
endpoint=module.params['ironic_url']
|
||||||
|
@ -245,15 +245,21 @@ def main():
|
|||||||
module = AnsibleModule(argument_spec, **module_kwargs)
|
module = AnsibleModule(argument_spec, **module_kwargs)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
module.params['auth_type'] in [None, 'None']
|
module.params['auth_type'] in [None, 'None', 'none']
|
||||||
and module.params['ironic_url'] is None
|
and module.params['ironic_url'] is None
|
||||||
|
and not module.params['cloud']
|
||||||
|
and not (module.params['auth']
|
||||||
|
and module.params['auth'].get('endpoint'))
|
||||||
):
|
):
|
||||||
module.fail_json(msg="Authentication appears disabled, Please "
|
module.fail_json(msg="Authentication appears to be disabled, "
|
||||||
"define an ironic_url parameter")
|
"Please define either ironic_url, or cloud, "
|
||||||
|
"or auth.endpoint")
|
||||||
|
|
||||||
if (
|
if (
|
||||||
module.params['ironic_url']
|
module.params['ironic_url']
|
||||||
and module.params['auth_type'] in [None, 'None']
|
and module.params['auth_type'] in [None, 'None', 'none']
|
||||||
|
and not (module.params['auth']
|
||||||
|
and module.params['auth'].get('endpoint'))
|
||||||
):
|
):
|
||||||
module.params['auth'] = dict(
|
module.params['auth'] = dict(
|
||||||
endpoint=module.params['ironic_url']
|
endpoint=module.params['ironic_url']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user