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
986ac80a
Commit
986ac80a
authored
7 years ago
by
Thomas Woerner
Browse files
Options
Downloads
Patches
Plain Diff
ipaserver: End play if server is already configured or client is configured
parent
4e2b6877
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
roles/ipaserver/library/ipaserver_test.py
+14
-4
14 additions, 4 deletions
roles/ipaserver/library/ipaserver_test.py
roles/ipaserver/tasks/install.yml
+2
-0
2 additions, 0 deletions
roles/ipaserver/tasks/install.yml
with
16 additions
and
4 deletions
roles/ipaserver/library/ipaserver_test.py
+
14
−
4
View file @
986ac80a
...
@@ -254,7 +254,13 @@ def main():
...
@@ -254,7 +254,13 @@ def main():
# domain_name
# domain_name
if
(
options
.
setup_dns
and
not
options
.
allow_zone_overlap
):
if
(
options
.
setup_dns
and
not
options
.
allow_zone_overlap
):
check_zone_overlap
(
options
.
domain_name
,
False
)
try
:
check_zone_overlap
(
options
.
domain_name
,
False
)
except
ValueError
as
e
:
if
"
already exists in DNS
"
in
str
(
e
):
ansible_module
.
log
(
str
(
e
))
ansible_module
.
exit_json
(
changed
=
False
,
dns_zone_exists
=
True
)
raise
# dm_password
# dm_password
with
redirect_stdout
(
ansible_log
):
with
redirect_stdout
(
ansible_log
):
...
@@ -425,16 +431,20 @@ def main():
...
@@ -425,16 +431,20 @@ def main():
if
not
options
.
external_ca
and
len
(
options
.
external_cert_files
)
<
1
and
\
if
not
options
.
external_ca
and
len
(
options
.
external_cert_files
)
<
1
and
\
is_ipa_configured
():
is_ipa_configured
():
options
.
_installation_cleanup
=
False
options
.
_installation_cleanup
=
False
ansible_module
.
fail_json
(
msg
=
ansible_module
.
log
(
"
IPA server is already configured on this system. If you want
"
"
IPA server is already configured on this system. If you want
"
"
to reinstall the IPA server, please uninstall it first.
"
)
"
to reinstall the IPA server, please uninstall it first.
"
)
ansible_module
.
exit_json
(
changed
=
False
,
server_already_configured
=
True
)
client_fstore
=
sysrestore
.
FileStore
(
paths
.
IPA_CLIENT_SYSRESTORE
)
client_fstore
=
sysrestore
.
FileStore
(
paths
.
IPA_CLIENT_SYSRESTORE
)
if
client_fstore
.
has_files
():
if
client_fstore
.
has_files
():
options
.
_installation_cleanup
=
False
options
.
_installation_cleanup
=
False
ansible_module
.
fail_json
(
ansible_module
.
log
(
msg
=
"
IPA client is already configured on this system.
"
"
IPA client is already configured on this system.
"
"
Please uninstall it before configuring the IPA server.
"
)
"
Please uninstall it before configuring the IPA server.
"
)
ansible_module
.
exit_json
(
changed
=
False
,
client_already_configured
=
True
)
# validate reverse_zones
# validate reverse_zones
if
not
options
.
allow_zone_overlap
:
if
not
options
.
allow_zone_overlap
:
...
...
This diff is collapsed.
Click to expand it.
roles/ipaserver/tasks/install.yml
+
2
−
0
View file @
986ac80a
...
@@ -91,6 +91,8 @@
...
@@ -91,6 +91,8 @@
### additional ###
### additional ###
register
:
result_ipaserver_test
register
:
result_ipaserver_test
-
meta
:
end_play
when
:
not result_ipaserver_test.changed and (result_ipaserver_test.dns_zone_exists is defined or result_ipaserver_test.client_already_configured is defined or result_ipaserver_test.server_already_configured is defined)
-
block
:
-
block
:
...
...
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