ipauser: Use PARAM_MAPPING and query state support

The ipauser module has been reworked to use the new PARAM_MAPPING added
to ansible_freeipa_module.

The member handling for manager, principal, certificate and certmapdata
has been simplified by using gen_member_add_del_lists. The member
entries in PARAM_MAPPING are now marked with "member": True. This
replaces the manual calls to gen_add_del_lists, gen_add_list and
gen_intersection_list across three separate action/state branches with
a single unified call.

The new query state allows to retrieve user information from IPA.
The query_param option controls which fields are returned: BASE for
essential fields, ALL for all fields, PKEY_ONLY for user names only,
or a list of specific field names.

Here is the updated documentation of the module:

    README-user.md

New tests for the query state can be found at:

    tests/user/test_user_query.yml
This commit is contained in:
Thomas Woerner
2026-06-16 13:10:12 +02:00
parent 964345aed8
commit fcf4a60de6
4 changed files with 718 additions and 573 deletions

View File

@@ -128,6 +128,22 @@
register: result
failed_when: result.changed or result.failed
- name: User pinky with email "pinky"
ipauser:
ipaadmin_password: SomeADMINpassword
name: pinky
email: pinky
register: result
failed_when: not result.changed or result.failed
- name: User pinky with email "pinky", again
ipauser:
ipaadmin_password: SomeADMINpassword
name: pinky
email: pinky
register: result
failed_when: result.changed or result.failed
- name: User pinky present with changed settings
ipauser:
ipaadmin_password: SomeADMINpassword