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/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/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/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: