diff --git a/plugins/modules/ipaservice.py b/plugins/modules/ipaservice.py
index 5c4363d83ad115737d8af017364c068b85afe69f..79ab96c7a7c0465d34eabc68f2fab108631716b9 100644
--- a/plugins/modules/ipaservice.py
+++ b/plugins/modules/ipaservice.py
@@ -288,7 +288,8 @@ def gen_args_smb(netbiosname, ok_as_delegate, ok_to_auth_as_delegate):
 
 
 def check_parameters(module, state, action, names, parameters):
-    assert isinstance(parameters, dict)
+    if not isinstance(parameters, dict):
+        raise AssertionError("parameters is not a dict")
 
     # invalid parameters for everything but state 'present', action 'service'.
     invalid = ['pac_type', 'auth_ind', 'skip_host_check',
diff --git a/roles/ipaclient/library/ipaclient_get_facts.py b/roles/ipaclient/library/ipaclient_get_facts.py
index 09fe7e84e511d8b5488d27ae8f0a208f8f082cdf..be5e79d7da513c0114ece4e5fce75acc6b4dcaa3 100644
--- a/roles/ipaclient/library/ipaclient_get_facts.py
+++ b/roles/ipaclient/library/ipaclient_get_facts.py
@@ -84,7 +84,8 @@ def is_dogtag_configured(subsystem):
     # ca / kra is configured when the directory
     # /var/lib/pki/pki-tomcat/[ca|kra] # exists
     available_subsystems = {'ca', 'kra'}
-    assert subsystem in available_subsystems
+    if subsystem not in available_subsystems:
+        raise AssertionError("Subsystem '%s' not available" % subsystem)
 
     return os.path.isdir(os.path.join(VAR_LIB_PKI_TOMCAT, subsystem))