mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-03-27 05:43:05 +00:00
So far a datetime object was created for the expiration dates krbpasswordexpiration and krbprincipalexpiration. This resulted in also sending these objects to the API. With this change, the dates are converted into strings using the LDAP_GENERALIZED_TIME_FORMAT defined in ipalib.constants. This way only strings are used with the IPA API. A new function has been added to ansible_freeipa_module: - date_string: Convert datetime to gernalized time format string This fuction is used on the result of user_show to convert the expiration dates to the gernalized time format string. The existing function date_format in ansible_freeipa_module has been renamed to convert_date and fixed in the way that it also uses date_string to return a gernalized time format string and not a datetime object. This function was only used in the ipauser module so far.
Writing a new Ansible FreeIPA module
A ansible-freeipa module should have:
-
Code:
- A module file placed in
plugins/modules/<ipa_module_name>.py
- A module file placed in
-
Documentation:
README-<module_name>.mdfile in the root directory and linked from the main README.md- Example playbooks in
playbooks/<module_name>/directory
-
Tests:
- Test cases (also playbooks) defined in
tests/<module_name>/test_<something>.yml. It's ok to have multiple files in this directory.
- Test cases (also playbooks) defined in
Use the script utils/new_module to create the stub files for a new module.