mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-31 03:44:41 +00:00
module templates: Add delete_commit code template.
This patch add the lines necessary to allow the use of the attribute `delete_continue`, as it is a commom attribute, and if newer commom attributes are added to IPAAnsibleModule in the future, the usage will be similar.
This commit is contained in:
@@ -36,6 +36,7 @@ short description: Manage FreeIPA $name
|
||||
description: Manage FreeIPA $name
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
- ipamodule_base_docs.delete_continue
|
||||
options:
|
||||
name:
|
||||
description: The list of $name name strings.
|
||||
@@ -124,6 +125,7 @@ def main():
|
||||
choices=["present", "absent"]),
|
||||
),
|
||||
supports_check_mode=True,
|
||||
ipa_module_options=["delete_continue"],
|
||||
)
|
||||
|
||||
ansible_module._ansible_debug = True
|
||||
@@ -140,6 +142,8 @@ def main():
|
||||
# these parameters, use IPAAnsibleModule.params_get_lowercase.
|
||||
PARAMETER2 = ansible_module.params_get_lowercase("PARAMETER2")
|
||||
|
||||
delete_continue = ansible_module.params_get("delete_continue")
|
||||
|
||||
# state
|
||||
state = ansible_module.params_get("state")
|
||||
|
||||
@@ -191,7 +195,9 @@ def main():
|
||||
|
||||
elif state == "absent":
|
||||
if res_find is not None:
|
||||
commands.append([name, "$name_del", {}])
|
||||
commands.append(
|
||||
[name, "$name_del", {"continue": delete_continue}]
|
||||
)
|
||||
|
||||
else:
|
||||
ansible_module.fail_json(msg="Unkown state '%s'" % state)
|
||||
|
||||
Reference in New Issue
Block a user