From 2fd1a55e63b6e1804568d3308365e5cfe855fc09 Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Thu, 29 Mar 2018 15:35:19 +0200 Subject: [PATCH] Fix ansible-lint job The 'linters' tox environment was not running on roles, it was only running on playbooks. This change adds a command to the linters environment to ensure all roles are linted. This also cleans up a comment in the tox file that was referring to a nonexistent zuul job. Change-Id: I04d9d79fca16a7f78f9c646f96e5fba78a5f5329 --- tox.ini | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 879168ccb9..13bf2c750a 100644 --- a/tox.ini +++ b/tox.ini @@ -15,7 +15,7 @@ setenv = passenv = # NOTE(pabelanger): if you'd like to run tox -elinters locally, you'll need # to export ANSIBLE_ROLES_PATH pointing to the currect repos. - # see infra-zuul-jobs-linters job for more information. + # see openstack-zuul-jobs-linters job for more information. ANSIBLE_ROLES_PATH # Add dependencies here since other jobs use python2 and zuul requires # python3. @@ -35,6 +35,8 @@ commands = # [ANSIBLE0012] Commands should not change things if nothing needs doing bash -c "find playbooks -type f -regex '.*.ya?ml' -print0 | \ xargs -t -n1 -0 ansible-lint -xANSIBLE0012" + bash -c 'find roles -maxdepth 1 -mindepth 1 -type d -printf "%p/\n" | \ + xargs -t -n1 ansible-lint -xANSIBLE0012' # Ansible Syntax Check bash -c "find playbooks -type f -regex '.*.ya?ml' -exec \ ansible-playbook --syntax-check -i {toxinidir}/tests/inventory \