diff --git a/bin/cdist-config b/bin/cdist-config
index d10f1ac7..d5c0464c 100644
--- a/bin/cdist-config
+++ b/bin/cdist-config
@@ -27,6 +27,9 @@ set -u
 # Fail if exited non-zero as well
 set -e
 
+# enable debugging
+[ "$__cdist_debug" ] && set -x
+
 ################################################################################
 # cconf standard vars prefixed with cdist