Skip to content

Commit

Permalink
dnszone: add support for delete_continue.
Browse files Browse the repository at this point in the history
Add support for attribute 'delete_continue' in ipadnszone.
  • Loading branch information
rjeffman committed Feb 15, 2022
1 parent 2f79bdc commit be66eba
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions README-dnszone.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion plugins/modules/ipadnszone.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
description: Manage FreeIPA dnszone
extends_documentation_fragment:
- ipamodule_base_docs
- ipamodule_arguments.delete_continue
options:
name:
description: The zone name string.
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -542,6 +547,7 @@ def main():
mutually_exclusive=[["name", "name_from_ip"]],
required_one_of=[["name", "name_from_ip"]],
supports_check_mode=True,
ipa_arguments=["delete_continue"],
)

exit_args = {}
Expand Down
1 change: 1 addition & 0 deletions tests/dnszone/env_cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit be66eba

Please sign in to comment.