From 487a3bd4ce30c636a932483a620cd2a03b7b2cff Mon Sep 17 00:00:00 2001 From: Rafael Guterres Jeffman Date: Tue, 8 Feb 2022 14:11:44 -0300 Subject: [PATCH] dnszone: add support for delete_continue. Add support for attribute 'delete_continue' in ipadnszone. --- README-dnszone.md | 1 + plugins/modules/ipadnszone.py | 8 +++++++- tests/dnszone/env_cleanup.yml | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README-dnszone.md b/README-dnszone.md index e6673dc003..89e4525244 100644 --- a/README-dnszone.md +++ b/README-dnszone.md @@ -225,6 +225,7 @@ Variable | Description | Required `nsec3param_rec`| NSEC3PARAM record for zone in format: hash_algorithm flags iterations salt | no `skip_overlap_check`| Force DNS zone creation even if it will overlap with an existing zone | no `skip_nameserver_check` | Force DNS zone creation even if nameserver is not resolvable | no +`delete_continue` \| `continue` | Continuous mode: don't stop on errors. Valid only if `state` is `absent`. Default: `yes` (bool) | no Return Values diff --git a/plugins/modules/ipadnszone.py b/plugins/modules/ipadnszone.py index ae9b75163c..8856603719 100644 --- a/plugins/modules/ipadnszone.py +++ b/plugins/modules/ipadnszone.py @@ -36,6 +36,7 @@ description: Manage FreeIPA dnszone extends_documentation_fragment: - ipamodule_base_docs + - ipamodule_base_docs.delete_continue options: name: description: The zone name string. @@ -474,7 +475,11 @@ def define_ipa_commands(self): self.commands.append((zone_name, "dnszone_disable", {})) if self.ipa_params.state == "absent" and zone is not None: - self.commands.append((zone_name, "dnszone_del", {})) + self.commands.append(( + zone_name, + "dnszone_del", + {"continue": bool(self.ipa_params.delete_continue)} + )) def process_results(self, _result, command, name, _args, exit_args): if command == "dnszone_add" and self.ipa_params.name_from_ip: @@ -542,6 +547,7 @@ def main(): mutually_exclusive=[["name", "name_from_ip"]], required_one_of=[["name", "name_from_ip"]], supports_check_mode=True, + ipa_module_options=["delete_continue"], ) exit_args = {} diff --git a/tests/dnszone/env_cleanup.yml b/tests/dnszone/env_cleanup.yml index 542247c388..c845c29195 100644 --- a/tests/dnszone/env_cleanup.yml +++ b/tests/dnszone/env_cleanup.yml @@ -11,4 +11,5 @@ - 2.0.192.in-addr.arpa. - 0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.f.ip6.arpa. - 1.0.0.0.e.f.a.c.8.b.d.0.1.0.0.2.ip6.arpa. + continue: no state: absent