diff --git a/roles/ipaserver/library/ipaserver_test.py b/roles/ipaserver/library/ipaserver_test.py
index c9f7cce21acc09be805ca328c2cbbb1be2c10489..a451b9f5f90f3743a53d7d9a81c0aeb9af06c510 100644
--- a/roles/ipaserver/library/ipaserver_test.py
+++ b/roles/ipaserver/library/ipaserver_test.py
@@ -730,7 +730,7 @@ def main():
             adtrust.install_check(False, options, api)
 
     except (RuntimeError, ValueError, ScriptError) as e:
-        module.fail_json(msg=str(e))
+        ansible_module.fail_json(msg=str(e))
 
     finally:
         try: