From b378d8a20f7ee92c2f3df605c40b704f7b80188b Mon Sep 17 00:00:00 2001 From: dubiousOne Date: Tue, 8 Mar 2016 11:29:29 -0800 Subject: [PATCH] init commit --- lint-it.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 lint-it.sh diff --git a/lint-it.sh b/lint-it.sh new file mode 100755 index 0000000..666631a --- /dev/null +++ b/lint-it.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# used by jenkins to lint ansible playbooks + +echo "=> Linting Ansible Code" +fail_ansible=0 +for f in `find . -name "*.yml"`; do + echo "==> LINTING $f" + ansible-lint $f + rc=$? + if [[ $rc != 0 ]]; then + echo "==> LINTING FAIL: $f" + fail_ansible=1 + fi +done + +if [[ $fail_ansible == 1 ]]; then + echo "=> FAIL" + exit 1 +else + echo "=> SUCCESS" +fi