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
This commit is contained in:
Jesse Pretorius 2017-12-11 17:36:43 +00:00
parent 0511133506
commit fa828752c5
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}