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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Ansible FreeIPA
Commits
29fb281b
Unverified
Commit
29fb281b
authored
Sep 3, 2021
by
Thomas Woerner
Committed by
GitHub
Sep 3, 2021
Browse files
Options
Downloads
Plain Diff
Merge pull request #582 from rjeffman/dnszone_add_check_mode_support
ipadnszone: add check mode support
parents
07b47cab
a84071b8
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
plugins/module_utils/ansible_freeipa_module.py
+4
-0
4 additions, 0 deletions
plugins/module_utils/ansible_freeipa_module.py
plugins/modules/ipadnszone.py
+1
-0
1 addition, 0 deletions
plugins/modules/ipadnszone.py
tests/dnszone/test_dnszone.yml
+27
-0
27 additions, 0 deletions
tests/dnszone/test_dnszone.yml
with
32 additions
and
0 deletions
plugins/module_utils/ansible_freeipa_module.py
+
4
−
0
View file @
29fb281b
...
@@ -962,6 +962,10 @@ else:
...
@@ -962,6 +962,10 @@ else:
def
_run_ipa_commands
(
self
):
def
_run_ipa_commands
(
self
):
"""
Execute commands in self.ipa_commands.
"""
"""
Execute commands in self.ipa_commands.
"""
if
self
.
check_mode
:
self
.
changed
=
len
(
self
.
ipa_commands
)
>
0
return
result
=
None
result
=
None
for
name
,
command
,
args
in
self
.
ipa_commands
:
for
name
,
command
,
args
in
self
.
ipa_commands
:
...
...
This diff is collapsed.
Click to expand it.
plugins/modules/ipadnszone.py
+
1
−
0
View file @
29fb281b
...
@@ -537,6 +537,7 @@ def main():
...
@@ -537,6 +537,7 @@ def main():
argument_spec
=
get_argument_spec
(),
argument_spec
=
get_argument_spec
(),
mutually_exclusive
=
[[
"
name
"
,
"
name_from_ip
"
]],
mutually_exclusive
=
[[
"
name
"
,
"
name_from_ip
"
]],
required_one_of
=
[[
"
name
"
,
"
name_from_ip
"
]],
required_one_of
=
[[
"
name
"
,
"
name_from_ip
"
]],
supports_check_mode
=
True
,
).
ipa_run
()
).
ipa_run
()
...
...
This diff is collapsed.
Click to expand it.
tests/dnszone/test_dnszone.yml
+
27
−
0
View file @
29fb281b
...
@@ -11,6 +11,24 @@
...
@@ -11,6 +11,24 @@
include_tasks
:
env_setup.yml
include_tasks
:
env_setup.yml
# Tests
# Tests
-
name
:
Check if zone is present, when in shouldn't be.
ipadnszone
:
ipaadmin_password
:
SomeADMINpassword
name
:
testzone.local
state
:
present
check_mode
:
yes
register
:
result
failed_when
:
not result.changed or result.failed
-
name
:
Check if zone is present again, when in shouldn't be.
ipadnszone
:
ipaadmin_password
:
SomeADMINpassword
name
:
testzone.local
state
:
present
check_mode
:
yes
register
:
result
failed_when
:
not result.changed or result.failed
-
name
:
Ensure zone is present.
-
name
:
Ensure zone is present.
ipadnszone
:
ipadnszone
:
ipaadmin_password
:
SomeADMINpassword
ipaadmin_password
:
SomeADMINpassword
...
@@ -19,6 +37,15 @@
...
@@ -19,6 +37,15 @@
register
:
result
register
:
result
failed_when
:
not result.changed or result.failed
failed_when
:
not result.changed or result.failed
-
name
:
Check if zone is present, when in should be.
ipadnszone
:
ipaadmin_password
:
SomeADMINpassword
name
:
testzone.local
state
:
present
check_mode
:
yes
register
:
result
failed_when
:
result.changed or result.failed
-
name
:
Ensure zone is present, again.
-
name
:
Ensure zone is present, again.
ipadnszone
:
ipadnszone
:
ipaadmin_password
:
SomeADMINpassword
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
sign in
to comment