Commit Graph

5 Commits

Author SHA1 Message Date
Ian Wienand 826a79f50f linter: update ansible-lint; add auto-download of roles
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
anything else.

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
ansible-lint.

Also I don't think we need a ansible-playbook --syntax-check step;
ansible-lint covers that.

Change-Id: I972f73037b9f904a555b81f3835ca5261639ed01
2022-08-12 09:29:11 +10:00
Ian Wienand 0326363e48 Update ansible-lint and add fake zuul_return
- 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
  without tox

Change-Id: Ie8935f47db855647e19ae091044e5ac1871f1551
Co-Authored-By: Sorin Sbarnea <ssbarnea@redhat.com>
Co-Authored-By: Andreas Jaeger <aj@suse.com>
2020-03-18 22:28:10 +01:00
Andreas Jaeger fd782318e4 Remove site_specs and playbooks/publish/service-types.yaml
playbooks/publish/service-types.yaml is not used anymore, with AFS
publishing it got obsoleted and can now be removed.

site_specs and site_specs_promote are not used anymore, remove them.

Change-Id: I0c3ca2455b4f8b721d48d44780dbc397ddc9cb20
2020-03-03 21:30:26 +01:00
Clark Boylan 4deddced0d Fix use of old site_logs secerts
The site_logs secret moved into opendev/basejobs and we renamed the
site_logs secret here into site_logs_project_config and site_specs.
Unfortauntely many of our playbooks in this repo were not updated to use
the new secret name so they cause some jobs to fail.

Fix this by updated the playbooks to use site_logs_project_config and
site_specs as appropriate.

Change-Id: I852a6362c35dd6aa17b0f767fceea811402dd90c
2019-02-08 12:26:22 -08:00
Andreas Jaeger 98664c6ab3 ansible-lint: Add tests/inventory and vars.yaml
add fake data for ansible syntax as invoced by tox.ini.

Co-Authored-By: Jesse Keating <omgjlk@us.ibm.com>
Change-Id: Iad8654c53ec6c68db72c40eddda3d79c8f4561dc
2017-10-28 19:03:51 +02:00