diff --git a/plugins/module_utils/ansible_freeipa_module.py b/plugins/module_utils/ansible_freeipa_module.py
index ff7b06dc353c4c105e57171a2ecd48c2531d1ddf..c5f8d7f287f5aa32ba0c994eb831d1f2a9dfe6f4 100644
--- a/plugins/module_utils/ansible_freeipa_module.py
+++ b/plugins/module_utils/ansible_freeipa_module.py
@@ -747,8 +747,8 @@ def exit_raw_json(module, **kwargs):
     contains sensible data, it will be appear in the logs.
     """
     module.do_cleanup_files()
-    print(jsonify(kwargs))
-    sys.exit(0)
+    print(jsonify(kwargs))  # pylint: disable=W0012,ansible-bad-function
+    sys.exit(0)  # pylint: disable=W0012,ansible-bad-function
 
 
 def __get_domain_validator():
diff --git a/plugins/modules/ipadnsrecord.py b/plugins/modules/ipadnsrecord.py
index 9fba3f70c0a45e443b0a2b267d5fc353d56541fc..75ae4492f4a9c01d067f607c4799a2c38e2dbf23 100644
--- a/plugins/modules/ipadnsrecord.py
+++ b/plugins/modules/ipadnsrecord.py
@@ -1394,15 +1394,16 @@ def gen_args(entry):
 
     if record_value is not None:
         record_type = entry['record_type']
-        rec = "{}record".format(record_type.lower())
+        rec = "{0}record".format(record_type.lower())
         args[rec] = ensure_data_is_list(record_value)
 
     else:
         for field in _RECORD_FIELDS:
             record_value = entry.get(field) or entry.get("%sord" % field)
             if record_value is not None:
+                # pylint: disable=use-maxsplit-arg
                 record_type = field.split('_')[0]
-                rec = "{}record".format(record_type.lower())
+                rec = "{0}record".format(record_type.lower())
                 args[rec] = ensure_data_is_list(record_value)
 
         records = {
diff --git a/roles/ipaclient/library/ipaclient_api.py b/roles/ipaclient/library/ipaclient_api.py
index 9193f603b02e42f50e16b4c551e13a75a477f7dd..db5929757b16aeb7e6d45cfb0f238fb98fd33e91 100644
--- a/roles/ipaclient/library/ipaclient_api.py
+++ b/roles/ipaclient/library/ipaclient_api.py
@@ -236,7 +236,8 @@ def main():
         except Exception as e:
             logger.debug("config_show failed %s", e, exc_info=True)
             module.fail_json(
-                "Failed to retrieve CA certificate subject base: {}".format(e),
+                "Failed to retrieve CA certificate subject base: "
+                "{0}".format(e),
                 rval=CLIENT_INSTALL_ERROR)
         else:
             subject_base = str(DN(config['ipacertificatesubjectbase'][0]))
diff --git a/roles/ipaclient/library/ipaclient_join.py b/roles/ipaclient/library/ipaclient_join.py
index 68379ea70fc885e9b28c7ab16f007cb0ff1a3ef1..afa722f62b9e38e4bd79fe8621b275bc04f0cefa 100644
--- a/roles/ipaclient/library/ipaclient_join.py
+++ b/roles/ipaclient/library/ipaclient_join.py
@@ -241,7 +241,7 @@ def main():
                                    config=krb_name)
                 except RuntimeError as e:
                     module.fail_json(
-                        msg="Kerberos authentication failed: {}".format(e))
+                        msg="Kerberos authentication failed: {0}".format(e))
 
         elif keytab:
             join_args.append("-f")
@@ -254,10 +254,10 @@ def main():
                                  attempts=kinit_attempts)
                 except GSSError as e:
                     module.fail_json(
-                        msg="Kerberos authentication failed: {}".format(e))
+                        msg="Kerberos authentication failed: {0}".format(e))
             else:
                 module.fail_json(
-                    msg="Keytab file could not be found: {}".format(keytab))
+                    msg="Keytab file could not be found: {0}".format(keytab))
 
         elif password:
             join_args.append("-w")
diff --git a/roles/ipaclient/library/ipaclient_test.py b/roles/ipaclient/library/ipaclient_test.py
index 449460a7cd2b9e056ee049b7f69bae041daca870..66dbf0923253f7ef963b97454789bdab2eef6aff 100644
--- a/roles/ipaclient/library/ipaclient_test.py
+++ b/roles/ipaclient/library/ipaclient_test.py
@@ -432,7 +432,7 @@ def main():
         if options.ca_cert_files is not None:
             for value in options.ca_cert_files:
                 if not isinstance(value, list):
-                    raise ValueError("Expected list, got {!r}".format(value))
+                    raise ValueError("Expected list, got {0!r}".format(value))
                 # this is what init() does
                 value = value[-1]
                 if not os.path.exists(value):
@@ -575,13 +575,13 @@ def main():
             hostname_source = "Machine's FQDN"
         if hostname != hostname.lower():
             raise ScriptError(
-                "Invalid hostname '{}', must be lower-case.".format(hostname),
+                "Invalid hostname '{0}', must be lower-case.".format(hostname),
                 rval=CLIENT_INSTALL_ERROR
             )
 
         if hostname in ('localhost', 'localhost.localdomain'):
             raise ScriptError(
-                "Invalid hostname, '{}' must not be used.".format(hostname),
+                "Invalid hostname, '{0}' must not be used.".format(hostname),
                 rval=CLIENT_INSTALL_ERROR)
 
         if hasattr(constants, "MAXHOSTNAMELEN"):
@@ -589,7 +589,7 @@ def main():
                 validate_hostname(hostname, maxlen=constants.MAXHOSTNAMELEN)
             except ValueError as e:
                 raise ScriptError(
-                    'invalid hostname: {}'.format(e),
+                    'invalid hostname: {0}'.format(e),
                     rval=CLIENT_INSTALL_ERROR)
 
         if hasattr(tasks, "is_nosssd_supported"):
@@ -695,7 +695,7 @@ def main():
                 rval=CLIENT_INSTALL_ERROR)
         if ret == ipadiscovery.NOT_FQDN:
             raise ScriptError(
-                "{} is not a fully-qualified hostname".format(hostname),
+                "{0} is not a fully-qualified hostname".format(hostname),
                 rval=CLIENT_INSTALL_ERROR)
         if ret in (ipadiscovery.NO_LDAP_SERVER, ipadiscovery.NOT_IPA_SERVER) \
                 or not ds.domain:
diff --git a/roles/ipareplica/library/ipareplica_enable_ipa.py b/roles/ipareplica/library/ipareplica_enable_ipa.py
index 2b4fee53f4464ad8a92d15cb066d85cb131b0a0f..a974165e25b46e994cbd6da35b70d428ddc1e904 100644
--- a/roles/ipareplica/library/ipareplica_enable_ipa.py
+++ b/roles/ipareplica/library/ipareplica_enable_ipa.py
@@ -171,7 +171,7 @@ def main():
         # Print a warning if CA role is only installed on one server
         if len(ca_servers) == 1:
             msg = u'''
-                WARNING: The CA service is only installed on one server ({}).
+                WARNING: The CA service is only installed on one server ({0}).
                 It is strongly recommended to install it on another server.
                 Run ipa-ca-install(1) on another master to accomplish this.
             '''.format(ca_servers[0])
diff --git a/roles/ipareplica/library/ipareplica_prepare.py b/roles/ipareplica/library/ipareplica_prepare.py
index bd28b9e21f919d3a54cc78f7b79b04370e543da3..9ab59b2247b3bb1d274f7fb7b0b1afae1db304c3 100644
--- a/roles/ipareplica/library/ipareplica_prepare.py
+++ b/roles/ipareplica/library/ipareplica_prepare.py
@@ -469,7 +469,7 @@ def main():
     env._finalize_core(**dict(constants.DEFAULT_CONFIG))
 
     # pylint: disable=no-member
-    xmlrpc_uri = 'https://{}/ipa/xml'.format(ipautil.format_netloc(env.host))
+    xmlrpc_uri = 'https://{0}/ipa/xml'.format(ipautil.format_netloc(env.host))
     if hasattr(ipaldap, "realm_to_ldapi_uri"):
         realm_to_ldapi_uri = ipaldap.realm_to_ldapi_uri
     else:
@@ -609,7 +609,7 @@ def main():
     ansible_log.debug("-- REMOTE_API --")
 
     ldapuri = 'ldaps://%s' % ipautil.format_netloc(config.master_host_name)
-    xmlrpc_uri = 'https://{}/ipa/xml'.format(
+    xmlrpc_uri = 'https://{0}/ipa/xml'.format(
         ipautil.format_netloc(config.master_host_name))
     remote_api = create_api(mode=None)
     remote_api.bootstrap(in_server=True,
diff --git a/roles/ipareplica/library/ipareplica_test.py b/roles/ipareplica/library/ipareplica_test.py
index 690d6fa726052382b53eeb7235ba75119ebafa0d..de491f2fec0cf59b5c706711e3ea4e1e05a78485 100644
--- a/roles/ipareplica/library/ipareplica_test.py
+++ b/roles/ipareplica/library/ipareplica_test.py
@@ -450,7 +450,7 @@ def main():
     if installer.ca_cert_files is not None:
         if not isinstance(installer.ca_cert_files, list):
             ansible_module.fail_json(
-                msg="Expected list, got {!r}".format(installer.ca_cert_files))
+                msg="Expected list, got {0!r}".format(installer.ca_cert_files))
         for cert in installer.ca_cert_files:
             if not os.path.exists(cert):
                 ansible_module.fail_json(msg="'%s' does not exist" % cert)
diff --git a/roles/ipareplica/module_utils/ansible_ipa_replica.py b/roles/ipareplica/module_utils/ansible_ipa_replica.py
index b56ae86136948f05c462baab720be397824bd235..fb168010307de9828d3b6c63842f5aa52d60192f 100644
--- a/roles/ipareplica/module_utils/ansible_ipa_replica.py
+++ b/roles/ipareplica/module_utils/ansible_ipa_replica.py
@@ -334,7 +334,7 @@ def gen_env_boostrap_finalize_core(etc_ipa, default_config):
 def api_bootstrap_finalize(env):
     # pylint: disable=no-member
     xmlrpc_uri = \
-        'https://{}/ipa/xml'.format(ipautil.format_netloc(env.host))
+        'https://{0}/ipa/xml'.format(ipautil.format_netloc(env.host))
     api.bootstrap(in_server=True,
                   context='installer',
                   confdir=paths.ETC_IPA,
@@ -479,7 +479,7 @@ def ansible_module_get_parsed_ip_addresses(ansible_module,
 
 def gen_remote_api(master_host_name, etc_ipa):
     ldapuri = 'ldaps://%s' % ipautil.format_netloc(master_host_name)
-    xmlrpc_uri = 'https://{}/ipa/xml'.format(
+    xmlrpc_uri = 'https://{0}/ipa/xml'.format(
         ipautil.format_netloc(master_host_name))
     remote_api = create_api(mode=None)
     remote_api.bootstrap(in_server=True,
diff --git a/roles/ipaserver/library/ipaserver_test.py b/roles/ipaserver/library/ipaserver_test.py
index 45f65a2be1b4bec3eae8d76ff7f13615e05e79d3..7498990fb1c0f5789b12b8a4cd66790d7ba7dd2e 100644
--- a/roles/ipaserver/library/ipaserver_test.py
+++ b/roles/ipaserver/library/ipaserver_test.py
@@ -211,6 +211,7 @@ options:
   random_serial_numbers:
     description: The installer random_serial_numbers setting
     type: bool
+    default: no
     required: no
   allow_zone_overlap:
     description: Create DNS zone even if it already exists
@@ -1067,7 +1068,7 @@ def main():
         try:
             validate_domain_name(realm_name, entity="realm")
         except ValueError as e:
-            raise ScriptError("Invalid realm name: {}".format(unicode(e)))
+            raise ScriptError("Invalid realm name: {0}".format(unicode(e)))
 
     if not options.setup_adtrust:
         # If domain name and realm does not match, IPA server will not be able
diff --git a/tests/external-signed-ca-with-automatic-copy/external-ca.sh b/tests/external-signed-ca-with-automatic-copy/external-ca.sh
index de5fceccdf957daac0ac75d10996d9598e05670d..5e66c50d1b05425341eb82744eda84b00f499b5e 100644
--- a/tests/external-signed-ca-with-automatic-copy/external-ca.sh
+++ b/tests/external-signed-ca-with-automatic-copy/external-ca.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -eu
 
 master=$1
 if [ -z "$master" ]; then
diff --git a/tests/group/groups.sh b/tests/group/groups.sh
index 63e36c0143e653cbb5dcf5ef889d40fc7a89ea3c..f7694b2e88dcfcaa27d090a13379ae2a86eab5a8 100644
--- a/tests/group/groups.sh
+++ b/tests/group/groups.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -eu
 
 NUM=${1-1000}
 FILE="groups.json"
diff --git a/tests/pytests/conftest.py b/tests/pytests/conftest.py
index 97e5e534781dc1881878de45aec3b1f09da767d9..e42d5f4ce8197c1749cf2e828b64169330243fb4 100644
--- a/tests/pytests/conftest.py
+++ b/tests/pytests/conftest.py
@@ -40,7 +40,7 @@ def pytest_configure(config):
     if os.path.exists(config_dir):
         inventory_path = os.path.join(config_dir, "test.inventory.yml")
         inventory = get_inventory(inventory_path)
-        print("Configuring execution using {}".format(inventory_path))
+        print("Configuring execution using {0}".format(inventory_path))
         ipaservers = inventory["all"]["children"]["ipaserver"]["hosts"]
         ipaserver = list(ipaservers.values())[0]
         private_key = os.path.join(config_dir, "id_rsa")
diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt
deleted file mode 100644
index e639f4787ed67efdc3fac398c66ce95080e96e8c..0000000000000000000000000000000000000000
--- a/tests/sanity/ignore-2.12.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-plugins/module_utils/ansible_freeipa_module.py compile-2.6!skip
-plugins/module_utils/ansible_freeipa_module.py import-2.6!skip
-plugins/module_utils/ansible_freeipa_module.py pylint:ansible-bad-function
-plugins/modules/ipaclient_get_facts.py compile-2.6!skip
-plugins/modules/ipaclient_get_facts.py import-2.6!skip
-plugins/modules/ipaclient_api.py pylint:ansible-format-automatic-specification
-plugins/modules/ipaclient_join.py pylint:ansible-format-automatic-specification
-plugins/modules/ipaclient_test.py pylint:ansible-format-automatic-specification
-plugins/modules/ipaconfig.py compile-2.6!skip
-plugins/modules/ipaconfig.py import-2.6!skip
-plugins/modules/ipadnsrecord.py compile-2.6!skip
-plugins/modules/ipadnsrecord.py import-2.6!skip
-plugins/modules/ipadnsrecord.py pylint:ansible-format-automatic-specification
-plugins/modules/ipadnsrecord.py pylint:use-maxsplit-arg
-plugins/modules/ipareplica_enable_ipa.py pylint:ansible-format-automatic-specification
-plugins/modules/ipareplica_prepare.py pylint:ansible-format-automatic-specification
-plugins/modules/ipareplica_test.py pylint:ansible-format-automatic-specification
-plugins/modules/iparole.py compile-2.6!skip
-plugins/modules/iparole.py import-2.6!skip
-plugins/modules/ipaserver_setup_ca.py compile-2.6!skip
-plugins/modules/ipaserver_setup_ca.py import-2.6!skip
-plugins/modules/ipaserver_test.py pylint:ansible-format-automatic-specification
-plugins/modules/ipaservice.py compile-2.6!skip
-plugins/modules/ipaservice.py import-2.6!skip
-plugins/modules/ipasudorule.py compile-2.6!skip
-plugins/modules/ipasudorule.py import-2.6!skip
-plugins/modules/ipavault.py compile-2.6!skip
-plugins/modules/ipavault.py import-2.6!skip
-roles/ipaclient/library/ipaclient_api.py pylint:ansible-format-automatic-specification
-roles/ipaclient/library/ipaclient_join.py pylint:ansible-format-automatic-specification
-roles/ipaclient/library/ipaclient_test.py pylint:ansible-format-automatic-specification
-roles/ipareplica/library/ipareplica_enable_ipa.py pylint:ansible-format-automatic-specification
-roles/ipareplica/library/ipareplica_prepare.py pylint:ansible-format-automatic-specification
-roles/ipareplica/library/ipareplica_test.py pylint:ansible-format-automatic-specification
-roles/ipaserver/library/ipaserver_test.py pylint:ansible-format-automatic-specification
-roles/ipareplica/module_utils/ansible_ipa_replica.py pylint:ansible-format-automatic-specification
-tests/external-signed-ca-with-automatic-copy/external-ca.sh shebang!skip
-tests/pytests/conftest.py pylint:ansible-format-automatic-specification
-tests/sanity/sanity.sh shebang!skip
-tests/user/users.sh shebang!skip
-tests/user/users_absent.sh shebang!skip
-tests/group/groups.sh shebang!skip
-tests/utils.py pylint:ansible-format-automatic-specification
-utils/ansible-doc-test shebang!skip
-utils/build-galaxy-release.sh shebang!skip
-utils/build-srpm.sh shebang!skip
-utils/changelog shebang!skip
-utils/check_test_configuration.py shebang!skip
-utils/galaxyfy-README.py shebang!skip
-utils/galaxyfy-module-EXAMPLES.py shebang!skip
-utils/galaxyfy-playbook.py shebang!skip
-utils/galaxyfy.py shebang!skip
-utils/gen_modules_docs.sh shebang!skip
-utils/lint_check.sh shebang!skip
-utils/new_module shebang!skip
diff --git a/tests/sanity/ignore-2.13.txt b/tests/sanity/ignore-2.13.txt
deleted file mode 100644
index d5525e7bd21641ac7d90b190a3782aaa660d361b..0000000000000000000000000000000000000000
--- a/tests/sanity/ignore-2.13.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-plugins/module_utils/ansible_freeipa_module.py pylint:ansible-bad-function
-plugins/modules/ipaclient_api.py pylint:ansible-format-automatic-specification
-plugins/modules/ipaclient_join.py pylint:ansible-format-automatic-specification
-plugins/modules/ipaclient_test.py pylint:ansible-format-automatic-specification
-plugins/modules/ipadnsrecord.py pylint:ansible-format-automatic-specification
-plugins/modules/ipadnsrecord.py pylint:use-maxsplit-arg
-plugins/modules/ipareplica_enable_ipa.py pylint:ansible-format-automatic-specification
-plugins/modules/ipareplica_prepare.py pylint:ansible-format-automatic-specification
-plugins/modules/ipareplica_test.py pylint:ansible-format-automatic-specification
-plugins/modules/ipaserver_test.py pylint:ansible-format-automatic-specification
-roles/ipaclient/library/ipaclient_api.py pylint:ansible-format-automatic-specification
-roles/ipaclient/library/ipaclient_join.py pylint:ansible-format-automatic-specification
-roles/ipaclient/library/ipaclient_test.py pylint:ansible-format-automatic-specification
-roles/ipareplica/library/ipareplica_enable_ipa.py pylint:ansible-format-automatic-specification
-roles/ipareplica/library/ipareplica_prepare.py pylint:ansible-format-automatic-specification
-roles/ipareplica/library/ipareplica_test.py pylint:ansible-format-automatic-specification
-roles/ipaserver/library/ipaserver_test.py pylint:ansible-format-automatic-specification
-roles/ipareplica/module_utils/ansible_ipa_replica.py pylint:ansible-format-automatic-specification
-tests/external-signed-ca-with-automatic-copy/external-ca.sh shebang!skip
-tests/pytests/conftest.py pylint:ansible-format-automatic-specification
-tests/sanity/sanity.sh shebang!skip
-tests/user/users.sh shebang!skip
-tests/user/users_absent.sh shebang!skip
-tests/group/groups.sh shebang!skip
-tests/utils.py pylint:ansible-format-automatic-specification
-utils/ansible-doc-test shebang!skip
-utils/build-galaxy-release.sh shebang!skip
-utils/build-srpm.sh shebang!skip
-utils/changelog shebang!skip
-utils/check_test_configuration.py shebang!skip
-utils/galaxyfy-README.py shebang!skip
-utils/galaxyfy-module-EXAMPLES.py shebang!skip
-utils/galaxyfy-playbook.py shebang!skip
-utils/galaxyfy.py shebang!skip
-utils/gen_modules_docs.sh shebang!skip
-utils/lint_check.sh shebang!skip
-utils/new_module shebang!skip
diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt
deleted file mode 100644
index d5525e7bd21641ac7d90b190a3782aaa660d361b..0000000000000000000000000000000000000000
--- a/tests/sanity/ignore-2.14.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-plugins/module_utils/ansible_freeipa_module.py pylint:ansible-bad-function
-plugins/modules/ipaclient_api.py pylint:ansible-format-automatic-specification
-plugins/modules/ipaclient_join.py pylint:ansible-format-automatic-specification
-plugins/modules/ipaclient_test.py pylint:ansible-format-automatic-specification
-plugins/modules/ipadnsrecord.py pylint:ansible-format-automatic-specification
-plugins/modules/ipadnsrecord.py pylint:use-maxsplit-arg
-plugins/modules/ipareplica_enable_ipa.py pylint:ansible-format-automatic-specification
-plugins/modules/ipareplica_prepare.py pylint:ansible-format-automatic-specification
-plugins/modules/ipareplica_test.py pylint:ansible-format-automatic-specification
-plugins/modules/ipaserver_test.py pylint:ansible-format-automatic-specification
-roles/ipaclient/library/ipaclient_api.py pylint:ansible-format-automatic-specification
-roles/ipaclient/library/ipaclient_join.py pylint:ansible-format-automatic-specification
-roles/ipaclient/library/ipaclient_test.py pylint:ansible-format-automatic-specification
-roles/ipareplica/library/ipareplica_enable_ipa.py pylint:ansible-format-automatic-specification
-roles/ipareplica/library/ipareplica_prepare.py pylint:ansible-format-automatic-specification
-roles/ipareplica/library/ipareplica_test.py pylint:ansible-format-automatic-specification
-roles/ipaserver/library/ipaserver_test.py pylint:ansible-format-automatic-specification
-roles/ipareplica/module_utils/ansible_ipa_replica.py pylint:ansible-format-automatic-specification
-tests/external-signed-ca-with-automatic-copy/external-ca.sh shebang!skip
-tests/pytests/conftest.py pylint:ansible-format-automatic-specification
-tests/sanity/sanity.sh shebang!skip
-tests/user/users.sh shebang!skip
-tests/user/users_absent.sh shebang!skip
-tests/group/groups.sh shebang!skip
-tests/utils.py pylint:ansible-format-automatic-specification
-utils/ansible-doc-test shebang!skip
-utils/build-galaxy-release.sh shebang!skip
-utils/build-srpm.sh shebang!skip
-utils/changelog shebang!skip
-utils/check_test_configuration.py shebang!skip
-utils/galaxyfy-README.py shebang!skip
-utils/galaxyfy-module-EXAMPLES.py shebang!skip
-utils/galaxyfy-playbook.py shebang!skip
-utils/galaxyfy.py shebang!skip
-utils/gen_modules_docs.sh shebang!skip
-utils/lint_check.sh shebang!skip
-utils/new_module shebang!skip
diff --git a/tests/sanity/sanity.sh b/tests/sanity/sanity.sh
index 2305813902e010826ccafc87bd442737e12fad74..ba56ade4f1017e2d4a678869d6b447b949959710 100644
--- a/tests/sanity/sanity.sh
+++ b/tests/sanity/sanity.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -eu
 
 TOPDIR=$(readlink -f "$(dirname "$0")/../..")
 pushd "${TOPDIR}" >/dev/null || exit 1
diff --git a/tests/user/users.sh b/tests/user/users.sh
index da408d751967314767e91832b1a1c53585e06a2f..8b1f5d298c387a4a3b3663f558f28ecdbb9ca450 100644
--- a/tests/user/users.sh
+++ b/tests/user/users.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -eu
 
 NUM=${1-1000}
 FILE="users.json"
diff --git a/tests/user/users_absent.sh b/tests/user/users_absent.sh
index f0179931360e52b60292c89340c8a5601aed8937..812c5d6ffea84498a18f8431f134c13bc25d15e7 100644
--- a/tests/user/users_absent.sh
+++ b/tests/user/users_absent.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -eu
 
 NUM=1000
 FILE="users_absent.json"
diff --git a/tests/utils.py b/tests/utils.py
index eb64bef582a1f1b520dfc4f6799becb87a23d7e2..9e3d5e83be0d7a1858fea9b29a58ef9b9ec5209b 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -180,7 +180,7 @@ def run_playbook(playbook, allow_failures=False):
     if allow_failures:
         return result
 
-    status_code_msg = "ansible-playbook return code: {}".format(
+    status_code_msg = "ansible-playbook return code: {0}".format(
         result.returncode
     )
     assert_msg = "\n".join(
diff --git a/utils/ansible-doc-test b/utils/ansible-doc-test
index 41afb63584c6b7d2fb26237fcdd91664395ef4ab..a0d7b2e7ed296032507ab10e4403d0454e12efba 100755
--- a/utils/ansible-doc-test
+++ b/utils/ansible-doc-test
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
 # Authors:
diff --git a/utils/ansible-freeipa.spec.in b/utils/ansible-freeipa.spec.in
index 9055ec47a236785086d2ad6d121f140de1b43ad0..f4d920740ff6044a5b23857935ade56620f28b9e 100644
--- a/utils/ansible-freeipa.spec.in
+++ b/utils/ansible-freeipa.spec.in
@@ -125,7 +125,7 @@ done
 
 for i in utils/*.py utils/new_module utils/changelog utils/ansible-doc-test;
 do
-    sed -i '{s@/usr/bin/python*@%{python}@}' $i
+    sed -i '{s@/usr/bin/env python*@%{python}@}' $i
 done
 
 
diff --git a/utils/build-galaxy-release.sh b/utils/build-galaxy-release.sh
index e3eb0b9c4e5f2c0e6c490e21f8aa9b0472d59fef..e427013e8ac0af8410e2979e04943d373ad09a59 100755
--- a/utils/build-galaxy-release.sh
+++ b/utils/build-galaxy-release.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -eu
 #
 # Build Ansible Collection from ansible-freeipa repo
 #
diff --git a/utils/build-srpm.sh b/utils/build-srpm.sh
index cb9c1361a8b337c54a1c9d016cafd16d535be03c..da3caac88af277129fb9bed0dda717c67de1e441 100755
--- a/utils/build-srpm.sh
+++ b/utils/build-srpm.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -eu
 
 git_version=$(git describe --tags | sed -e "s/^v//")
 version=${git_version%%-*}
diff --git a/utils/changelog b/utils/changelog
index 65234ef31ac756dc3b12884b9ad2ffb9e52396cf..c78c28d84ac1770fe34a3988eec81d44939c63b7 100755
--- a/utils/changelog
+++ b/utils/changelog
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
 # Authors:
diff --git a/utils/check_test_configuration.py b/utils/check_test_configuration.py
index 162ad906451498562b7222d2e346f6629669a015..104ede917d4374df283a89de063f5d00358cdff9 100755
--- a/utils/check_test_configuration.py
+++ b/utils/check_test_configuration.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 """Check which tests are scheduled to be executed."""
 
diff --git a/utils/galaxyfy-README.py b/utils/galaxyfy-README.py
index daa45213281da2e23176fcc12ffc56ffd26e9f30..0fc5e514177ae939a8dbcb1798f2c4b0bcdc2199 100644
--- a/utils/galaxyfy-README.py
+++ b/utils/galaxyfy-README.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
 # Authors:
diff --git a/utils/galaxyfy-module-EXAMPLES.py b/utils/galaxyfy-module-EXAMPLES.py
index 46a740bedb704763f6287b31a21437ce09d2522e..a826a27076874eeb01253bf3f867aa0bee2564be 100644
--- a/utils/galaxyfy-module-EXAMPLES.py
+++ b/utils/galaxyfy-module-EXAMPLES.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
 # Authors:
diff --git a/utils/galaxyfy-playbook.py b/utils/galaxyfy-playbook.py
index a0c51c9e8b28f6b4df49afcbd58c5f2258d6339f..8614e2bf8c3a59d44fb97cd91eed73a7c407e5c2 100644
--- a/utils/galaxyfy-playbook.py
+++ b/utils/galaxyfy-playbook.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
 # Authors:
diff --git a/utils/galaxyfy.py b/utils/galaxyfy.py
index 7fef051553ef73fae8fc750734d9eaa605fd8d7a..1aae14a99a3982ae89c51d304cab9e627526989e 100644
--- a/utils/galaxyfy.py
+++ b/utils/galaxyfy.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
 # Authors:
diff --git a/utils/gen_modules_docs.sh b/utils/gen_modules_docs.sh
index 302e82ab2c8da8905df0e35c247c24e3d5a85561..6ef53be7e369af6e91e08c1063e4358f2211d5e2 100644
--- a/utils/gen_modules_docs.sh
+++ b/utils/gen_modules_docs.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -eu
 
 for i in roles/ipa*/*/*.py; do
     python utils/gen_module_docs.py "$i"
diff --git a/utils/lint_check.sh b/utils/lint_check.sh
index a32b6499c11592e5cebd29f38f6fc3c3f24f548b..61c3b0b91eed98157fb40f2e293ab7f1fd16014a 100755
--- a/utils/lint_check.sh
+++ b/utils/lint_check.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -eu
 
 INFO="\033[37;1m"
 WARN="\033[33;1m"
diff --git a/utils/new_module b/utils/new_module
index 58e47d06e54599dcf9c9414f4ccfa272def63c58..86a9f94a2602fe7aace30b36a9c72770e2b2737d 100755
--- a/utils/new_module
+++ b/utils/new_module
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -eu
 # -*- coding: utf-8 -*-
 
 # Authors: