From 083396e133219b82b9f7a92af129fd1c54662770 Mon Sep 17 00:00:00 2001 From: Rafael Guterres Jeffman <rjeffman@redhat.com> Date: Tue, 11 Apr 2023 15:18:11 -0300 Subject: [PATCH] module_utils: Export Ansible's 'boolean' parsing function. Export Ansible's 'boolean' parsing function so it can be used to verify if a string can be handled as a truthy value, allowing module parameters to use strings instead of bools, as strings can be cleared by using empty strings. --- plugins/module_utils/ansible_freeipa_module.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/module_utils/ansible_freeipa_module.py b/plugins/module_utils/ansible_freeipa_module.py index 6bae7cc3..0af0d63e 100644 --- a/plugins/module_utils/ansible_freeipa_module.py +++ b/plugins/module_utils/ansible_freeipa_module.py @@ -30,7 +30,7 @@ __all__ = ["gssapi", "netaddr", "api", "ipalib_errors", "Env", "kinit_password", "kinit_keytab", "run", "DN", "VERSION", "paths", "tasks", "get_credentials_if_valid", "Encoding", "DNSName", "getargspec", "certificate_loader", - "write_certificate_list"] + "write_certificate_list", "boolean"] import os # ansible-freeipa requires locale to be C, IPA requires utf-8. @@ -49,6 +49,7 @@ from ansible.module_utils._text import to_text from ansible.module_utils.common.text.converters import jsonify from ansible.module_utils import six from ansible.module_utils.common._collections_compat import Mapping +from ansible.module_utils.parsing.convert_bool import boolean # Import getargspec from inspect or provide own getargspec for # Python 2 compatibility with Python 3.11+. -- GitLab