Skip to content

Commit

Permalink
dnsforwardzone: add support for delete_continue.
Browse files Browse the repository at this point in the history
Add support for attribute 'delete_continue' in ipadnsforwardzone..
  • Loading branch information
rjeffman committed Feb 15, 2022
1 parent 42ddf17 commit 6604cd7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions README-dnsforwardzone.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ Variable | Description | Required
`forwardpolicy` \| `idnsforwardpolicy` | Per-zone conditional forwarding policy. Possible values are `only`, `first`, `none`. Set to "none" to disable forwarding to global forwarder for this zone. In that case, conditional zone forwarders are disregarded. | no
`skip_overlap_check` | Force DNS zone creation even if it will overlap with an existing zone. Defaults to False. | no
`permission` | Allow DNS Forward Zone to be managed. (bool) | no
`delete_continue` \| `continue` | Continuous mode: don't stop on errors. Valid only if `state` is `absent`. Default: `yes` (bool) | no
`action` | Work on group or member level. It can be on of `member` or `dnsforwardzone` and defaults to `dnsforwardzone`. | no
`state` | The state to ensure. It can be one of `present`, `absent`, `enabled` or `disabled`, default: `present`. | yes

Expand Down
5 changes: 4 additions & 1 deletion plugins/modules/ipadnsforwardzone.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
- Add and delete an IPA DNS Forwarder Zones using IPA API
extends_documentation_fragment:
- ipamodule_base_docs
- ipamodule_arguments.delete_continue
options:
name:
description:
Expand Down Expand Up @@ -202,6 +203,7 @@ def main():
choices=['present', 'absent', 'enabled', 'disabled']),
),
supports_check_mode=True,
ipa_arguments=["delete_continue"],
)

ansible_module._ansible_debug = True
Expand All @@ -214,6 +216,7 @@ def main():
forwardpolicy = ansible_module.params_get("forwardpolicy")
skip_overlap_check = ansible_module.params_get("skip_overlap_check")
permission = ansible_module.params_get("permission")
delete_continue = ansible_module.params_get("delete_continue")
state = ansible_module.params_get("state")

if state == 'present' and len(names) != 1:
Expand Down Expand Up @@ -326,7 +329,7 @@ def main():
# exists but should be absent
# set command
command = "dnsforwardzone_del"
args = {}
args = {"continue": bool(delete_continue)}

elif operation == "update":
# exists and is updating
Expand Down
1 change: 1 addition & 0 deletions tests/dnsforwardzone/test_dnsforwardzone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
name:
- example.com
- newfailzone.com
continue: no
state: absent

- name: ensure forwardzone example.com is created
Expand Down

0 comments on commit 6604cd7

Please sign in to comment.