mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-06-10 02:35:54 +00:00
ansible-test with ansible-2.14 is adding a lot of new tests to ensure that the documentation section and the agument spec is complete. Needed changes: DOCUMENTATION section - `type: str` needs to be set for string parameters - `type: list` needs to be set for list parameters - `elements: str` needs to be given for list of string parameters - `elements: dict` needs to be given for list of dict parameters - `aliases` tag needs to match `argument_spec` - `author` needs to be given with the github user also: `Name (@user)` RETURN section - `contains` needs to be used instead of `options` for dicts - `type: str` needs to be used for string parameters argument_spec - `elements="str"` needs to be added to all list of string parameters - `no_log=False` or `no_log=True` needs to be set for all parameters that have `password` in the name The `copyright` date is extended with `-2022`. Note: The alias "login" was used for "users" instead of "users"->"name". "login" is an alias for "name" if "users" is not used.
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.