diff --git a/changelogs/fragments/151-check-auth-params-for-existence.yaml b/changelogs/fragments/151-check-auth-params-for-existence.yaml new file mode 100644 index 0000000000..d251f08f56 --- /dev/null +++ b/changelogs/fragments/151-check-auth-params-for-existence.yaml @@ -0,0 +1,3 @@ +--- +bugfixes: + - check auth params for existence, not whether they are true (https://github.com/ansible-collections/kubernetes.core/pull/151). diff --git a/plugins/module_utils/common.py b/plugins/module_utils/common.py index e3a48cca03..48e55ec044 100644 --- a/plugins/module_utils/common.py +++ b/plugins/module_utils/common.py @@ -124,7 +124,7 @@ def _raise_or_fail(exc, msg): # If authorization variables aren't defined, look for them in environment variables for true_name, arg_name in AUTH_ARG_MAP.items(): - if module and module.params.get(arg_name): + if module and module.params.get(arg_name) is not None: auth[true_name] = module.params.get(arg_name) elif arg_name in kwargs and kwargs.get(arg_name) is not None: auth[true_name] = kwargs.get(arg_name)