This updates ansible-lint to the 6.x releases. It also updates the
ansible installed to our current zuul version.
It cleans up the config file and marks it as yaml. A few new
exceptions are added with explainations.
We don't need to fake the zuul_return by telling ansible-lint to mock
it. This is added to the config, and we can remove the stub file.
A constant source of problems running this locally is that you have to
have the other role repos checked out so ansible-lint can do its
checks. Add a smaller helper script for doing this locally. In the
gate, ANSIBLE_ROLES_PATH is set to the Zuul checkouts of these
projects. Locally, add a smaller helper "ansible-lint-roles-cache.sh"
that pulls the projects into a .cache directory. If they are already
there, they get updated. By default locally we will use these
checkouts. This way, "tox -e linters" just works without having to do
This also modifies the xargs to run the check all at once, instead of
fork for each file. I did try autodetection but it seems like other
yaml files in the roles/playbook directories still confuse
Also I don't think we need a ansible-playbook --syntax-check step;
ansible-lint covers that.
- Use zuul_return fake module to make ansible lint happy, this allows
to remove Zuul import.
- While ansible-lint 4.2.0 is now able to detect playbooks/roles, this
is broken, so don't use it
- move its config out of tox.ini so it can be used by any tools, or
Co-Authored-By: Sorin Sbarnea <email@example.com>
Co-Authored-By: Andreas Jaeger <firstname.lastname@example.org>