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

ipaserver_prepare: Properly report error, do show trace back

The raises of RuntimeError, ValueError and ScriptError are currently not
properly handled in ipaserver_prepare. This results in a trace back error
shown in Ansible instead of only showing the error message.

This happened for example if a nameserver is in /etc/resolv.conf that is
not reachable.
parent da2631d9
Branches
Tags
No related merge requests found
......@@ -195,6 +195,8 @@ def main():
if not options.ca_subject:
options.ca_subject = str(default_ca_subject_dn(options.subject_base))
try:
# Configuration for ipalib, we will bootstrap and finalize later, after
# we are sure we have the configuration file ready.
cfg = dict(
......@@ -286,6 +288,10 @@ def main():
if tasks.configure_pkcs11_modules(fstore):
ansible_log.info("Disabled p11-kit-proxy")
except (RuntimeError, ValueError, ScriptError,
ipautil.CalledProcessError) as e:
ansible_module.fail_json(msg=str(e))
ansible_module.exit_json(changed=True,
### basic ###
ip_addresses=[ str(ip) for ip in ip_addresses ],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment