mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-07 22:03:18 +00:00
ipapermission: add version check for bind type 'self'
FreeIPA 4.8.7 has introduced bind type 'self' as a valid value, and this PR adds checks so the module fails early if the value is used with an unsupported version. Tests and documentation have been updated to reflect the changes.
This commit is contained in:
@@ -152,7 +152,8 @@ RETURN = """
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.ansible_freeipa_module import \
|
||||
temp_kinit, temp_kdestroy, valid_creds, api_connect, api_command, \
|
||||
compare_args_ipa, module_params_get, gen_add_del_lists
|
||||
compare_args_ipa, module_params_get, gen_add_del_lists, \
|
||||
api_check_ipa_version
|
||||
import six
|
||||
|
||||
if six.PY3:
|
||||
@@ -336,6 +337,10 @@ def main():
|
||||
msg="Argument '%s' can not be used with action "
|
||||
"'%s' and state '%s'" % (x, action, state))
|
||||
|
||||
if bindtype == "self" and api_check_ipa_version("<", "4.8.7"):
|
||||
ansible_module.fail_json(
|
||||
msg="Bindtype 'self' is not supported by your IPA version.")
|
||||
|
||||
# Init
|
||||
|
||||
changed = False
|
||||
|
||||
Reference in New Issue
Block a user