diff --git a/roles/ipaclient/library/ipadiscovery.py b/roles/ipaclient/library/ipadiscovery.py
index 396705cfe2528dc2fe9bdc115c11e19490deb645..418c75287c167178196089be76d467974e95972e 100644
--- a/roles/ipaclient/library/ipadiscovery.py
+++ b/roles/ipaclient/library/ipadiscovery.py
@@ -274,11 +274,11 @@ def main():
 
     if options.ntp_servers and options.no_ntp:
         module.fail_json(
-            "--ntp-server cannot be used together with --no-ntp")
+            msg="--ntp-server cannot be used together with --no-ntp")
 
     if options.ntp_pool and options.no_ntp:
         module.fail_json(
-            "--ntp-pool cannot be used together with --no-ntp")
+            msg="--ntp-pool cannot be used together with --no-ntp")
 
     #if options.no_nisdomain and options.nisdomain:
     #    module.fail_json(
diff --git a/roles/ipaserver/library/ipaserver_test.py b/roles/ipaserver/library/ipaserver_test.py
index 7d38684734cc6e9a208142cf55bf548943b01cc2..2ca62058386a10cfae3bc5051de22c3c803cdccf 100644
--- a/roles/ipaserver/library/ipaserver_test.py
+++ b/roles/ipaserver/library/ipaserver_test.py
@@ -261,7 +261,7 @@ def main():
         try:
             check_zone_overlap(options.domain_name, False)
         except ValueError as e:
-            ansible_module.fail_json(str(e))
+            ansible_module.fail_json(msg=str(e))
 
     # dm_password
     with redirect_stdout(ansible_log):