Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Ansible FreeIPA
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Ansible FreeIPA
Commits
3f785bc0
Commit
3f785bc0
authored
4 years ago
by
Rafael Guterres Jeffman
Browse files
Options
Downloads
Patches
Plain Diff
Fix error message when adding dnsforwardzone without forwarders.
parent
f8ebca76
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
plugins/modules/ipadnsforwardzone.py
+5
-0
5 additions, 0 deletions
plugins/modules/ipadnsforwardzone.py
tests/dnsforwardzone/test_dnsforwardzone.yml
+11
-2
11 additions, 2 deletions
tests/dnsforwardzone/test_dnsforwardzone.yml
with
16 additions
and
2 deletions
plugins/modules/ipadnsforwardzone.py
+
5
−
0
View file @
3f785bc0
...
...
@@ -217,6 +217,11 @@ def main():
# Make sure forwardzone exists
existing_resource
=
find_dnsforwardzone
(
ansible_module
,
name
)
# validate parameters
if
state
==
'
present
'
:
if
existing_resource
is
None
and
not
forwarders
:
ansible_module
.
fail_json
(
msg
=
'
No forwarders specified.
'
)
if
existing_resource
is
None
and
operation
==
"
update
"
:
# does not exist and is updating
# trying to update something that doesn't exist, so error
...
...
This diff is collapsed.
Click to expand it.
tests/dnsforwardzone/test_dnsforwardzone.yml
+
11
−
2
View file @
3f785bc0
...
...
@@ -5,10 +5,12 @@
gather_facts
:
false
tasks
:
-
name
:
ensure forwardzone
example.com is
absent - prep
-
name
:
ensure
test
forwardzone
s are
absent - prep
ipadnsforwardzone
:
ipaadmin_password
:
SomeADMINpassword
name
:
example.com
name
:
-
example.com
-
newfailzone.com
state
:
absent
-
name
:
ensure forwardzone example.com is created
...
...
@@ -207,6 +209,13 @@
register
:
result
failed_when
:
result.changed
-
name
:
Ensure forwardzone is not added without forwarders, with correct message.
ipadnsforwardzone
:
ipaadmin_password
:
SomeADMINpassword
name
:
newfailzone.com
register
:
result
failed_when
:
not result.failed or "No forwarders specified" not in result.msg
-
name
:
ensure forwardzone example.com is absent - tidy up
ipadnsforwardzone
:
ipaadmin_password
:
SomeADMINpassword
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment