module templates: Add example and note for case insensitive members.

Some modules should be compared in a case insensitive manner, and this
patch adds an example of a call to IPAAnsibleModule.params_get_lowercase
and a note on its usage.
This commit is contained in:
Rafael Guterres Jeffman
2022-02-03 15:42:04 -03:00
parent 8772379dcc
commit 5d6324e2da
2 changed files with 8 additions and 2 deletions

View File

@@ -163,7 +163,10 @@ def main():
# present
PARAMETER1 = ansible_module.params_get("PARAMETER1")
PARAMETER2 = ansible_module.params_get("PARAMETER2")
# Note: some parameters must be compared in a case insensitive way,
# or are transliterated into its lowercase version by IPA API. For
# these parameters, use IPAAnsibleModule.params_get_lowercase.
PARAMETER2 = ansible_module.params_get_lowercase("PARAMETER2")
action = ansible_module.params_get("action")
# state

View File

@@ -135,7 +135,10 @@ def main():
# present
PARAMETER1 = ansible_module.params_get("PARAMETER1")
PARAMETER2 = ansible_module.params_get("PARAMETER2")
# Note: some parameters must be compared in a case insensitive way,
# or are transliterated into its lowercase version by IPA API. For
# these parameters, use IPAAnsibleModule.params_get_lowercase.
PARAMETER2 = ansible_module.params_get_lowercase("PARAMETER2")
# state
state = ansible_module.params_get("state")