Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnsforwardzone: add support for delete_continue. #765

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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_base_docs.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_module_options=["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