Skip to content
Snippets Groups Projects
Commit 88cbbf63 authored by Thomas Woerner's avatar Thomas Woerner
Browse files

ipareplica_test: Dop not fail, but end play if replica is already installed

Up to now the try to deploy an already deployed replica resulted in an
error. Now this ends in an end play and no error is reported.
parent 7ce09b2c
No related branches found
No related tags found
No related merge requests found
......@@ -297,7 +297,12 @@ def main():
with redirect_stdout(ansible_log):
common_check(options.no_ntp)
except Exception as msg: #ScriptError as msg:
ansible_module.fail_json(msg=str(msg))
_msg = str(msg)
if "server is already configured" in _msg:
ansible_module.exit_json(changed=False,
server_already_configured=True)
else:
ansible_module.fail_json(msg=_msg)
# TODO: Check ntp_servers and ntp_pool
......@@ -321,7 +326,7 @@ def main():
# done #
ansible_module.exit_json(changed=True,
ansible_module.exit_json(changed=False,
ipa_python_version=IPA_PYTHON_VERSION,
### basic ###
domain=options.domain_name,
......
......@@ -68,6 +68,9 @@
no_dnssec_validation: "{{ ipareplica_no_dnssec_validation }}"
register: result_ipareplica_test
- meta: end_play
when: result_ipareplica_test.client_already_configured is defined or result_ipareplica_test.server_already_configured is defined
- block:
- name: Install - Setup client
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment