summaryrefslogtreecommitdiff
path: root/tests/ansible-lint-test.sh
blob: 1d9350e9e923783f46acedd6765012b6f0185b6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash -x

echo "=> Linting Ansible Code"
fail_ansible=0
for f in `find ../ -name "*.yml"`; do
    echo "==> LINTING $f"
    ansible-lint -x ANSIBLE0004,ANSIBLE0016 $f # Ignore GIT check
    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