Allow additional parameters for ansible-lint

In order to facilitate providing additional parameters
to ansible-lint for any tests, we add an additional
environment variable for it.

We also add the printing out of any extra parameters
given to the lint test to ease troubleshooting.

Related-Bug: #1737310
Change-Id: If5746d35ee1b8ce5d6fd1a14a2abca16e29cb899
(cherry picked from commit fa828752c5)
This commit is contained in:
Jesse Pretorius 2017-12-11 17:36:43 +00:00 committed by Jesse Pretorius (odyssey4me)
parent 2326354c39
commit 1b8116b86c
1 changed files with 5 additions and 1 deletions

View File

@ -31,6 +31,10 @@ set -e
export WORKING_DIR=${WORKING_DIR:-$(pwd)}
export COMMON_TESTS_PATH="${WORKING_DIR}/tests/common"
export TEST_PLAYBOOK=${TEST_PLAYBOOK:-$WORKING_DIR/tests/test.yml}
export ANSIBLE_LINT_PARAMS=${ANSIBLE_LINT_PARAMS:-}
echo "TEST_PLAYBOOK: ${TEST_PLAYBOOK}"
echo "ANSIBLE_LINT_PARAMS: ${ANSIBLE_LINT_PARAMS}"
## Main ----------------------------------------------------------------------
@ -38,4 +42,4 @@ export TEST_PLAYBOOK=${TEST_PLAYBOOK:-$WORKING_DIR/tests/test.yml}
source "${COMMON_TESTS_PATH}/test-ansible-env-prep.sh"
# Execute ansible-lint
ansible-lint -R -r ${COMMON_TESTS_PATH}/ansible-lint/ ${TEST_PLAYBOOK}
ansible-lint ${ANSIBLE_LINT_PARAMS} -R -r ${COMMON_TESTS_PATH}/ansible-lint/ ${TEST_PLAYBOOK}