From 885e48c1b64e27373a880a3ad0e3a3649a388f5e Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Mon, 2 Nov 2020 09:56:34 +0000 Subject: [PATCH] Refreshes calling of ansible-lint - Assure compatible version of Ansible is installed - Make use of ability to detect roles and playbooks in linter, which also makes it execution ~9x faster. Change-Id: Ife53d9f3161f6531102ed82f62f5d91c805e6cdc --- test-requirements.txt | 5 +++-- tox.ini | 6 +----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index 3b4fb9fc..3d8fe79b 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,6 +4,7 @@ hacking>=3.0,<3.1.0 # Apache-2.0 -ansible>=2.7.0,<2.8 -ansible-lint>=4,<=5 +# ansible-lint requires ansible>=2.9 +ansible>=2.9.0,<2.10 +ansible-lint>=4.3.6,<=5 bashate>=0.2 diff --git a/tox.ini b/tox.ini index 52323e26..20b3c0d6 100644 --- a/tox.ini +++ b/tox.ini @@ -32,11 +32,7 @@ setenv = ANSIBLE_LIBRARY= {toxinidir}/tests/fake-ansible commands = flake8 {posargs} - bash -c "find playbooks -type d -name "legacy" -prune -o \ - -type f -regex '.*.y[a]ml' -print0 | xargs -t -n1 -0 \ - ansible-lint" - bash -c 'find roles -maxdepth 1 -mindepth 1 -type d -printf "%p/\n" | \ - xargs -t -n1 ansible-lint' + ansible-lint # Ansible Syntax Check bash -c "cd playbooks; find . -type f -regex '.*.y[a]?ml' -exec \ ansible-playbook --syntax-check -i {toxinidir}/tests/inventory \{\} + > /dev/null"