From fa828752c51911646664216f1726959a022e0721 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Mon, 11 Dec 2017 17:36:43 +0000 Subject: [PATCH] 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 --- test-ansible-lint.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test-ansible-lint.sh b/test-ansible-lint.sh index 76ea4569..6b395425 100755 --- a/test-ansible-lint.sh +++ b/test-ansible-lint.sh @@ -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}