mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-07 13:53:23 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user