Commit Graph

32 Commits

Author SHA1 Message Date
Ian Wienand 5e012776ad
flake8 : ignore .cache subdirectory, avoid broken ansible-compat
This role pulls in zuul-jobs/system-config, etc. for roles into
.cache.  We don't want to flake8 them as part of this job; ignore the
.cache subdir.

This also avoids a broken release of ansible-compat per the linked bug
(I'm assuming the next version will fix it, so optimistically not
using <)

Change-Id: I5cf3029e40fcc0e02ba4d104beb59a1c75509a77
2023-05-02 12:49:16 +10:00
Ghanshyam Mann 7189fb47ca Fix tox4 error
tox.ini started failing with tox4 which had some
incompatible changes. One of them is to allow
external command to run by adding them into allowlist_externals

Fixing tox.ini for tox4 changes.

Change-Id: Ic0620d5c3219aed10b33b0de645078eea3774ce9
2023-01-04 14:48:10 -06:00
Ian Wienand 34a45ddb78 linters: update to ansible-lint 6
This updates to ansible-lint 6.  Similar to
I972f73037b9f904a555b81f3835ca5261639ed01 it provides a helper for
installing required roles for linting.

There is no need for a separate syntax checking step, as that is done
by ansible-lint.

Change-Id: I270c50bd5b3ac8db583bc2ba48e254175c91db03
2022-07-28 15:24:38 +10:00
Sorin Sbarnea 885e48c1b6 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
2020-11-02 10:01:57 +00:00
Daniel Bengtsson 127a3443c0 Stop configuring install_command in tox.
Currently, we are overriding 'install_command' to use 'pip'. This is
considered poor behavior and 'python -m pip' should be used instead:

https://snarky.ca/why-you-should-use-python-m-pip/

It turns out that this is the the default value provided by tox:

https://tox.readthedocs.io/en/latest/config.html#conf-install_command

So we can remove the line and simply use the default value.

Change-Id: Iafcae9fb2c7ae1046bec6fc38d9f57a6bff7e088
2020-05-26 12:36:35 +02:00
Monty Taylor 9a49d142b2 Use a fake zuul_return and an .ansible-lint file
ansible-lint now supports settings in a file, including exclude_paths.
This lets us simplfy the ansible-lint command. Also, stop installing
zuul and just use a fake zuul_return to fake out ansible-lint.

Change-Id: I40291d4e861fe9e6e3341b075ab7d6c9f5315275
2020-03-12 07:29:39 +00:00
Zuul 0dba4fbe3b Merge "Update ansible-lint" 2020-01-24 09:33:59 +00:00
Andreas Jaeger 1dde1e30e9 Update docs building
Switch from python setup.py to calling sphinx-build directly, add
a new doc requirements.txt file.

Change-Id: I199b8ceff5740c775804ff0db52704df8cbd7b86
2020-01-19 16:55:45 +01:00
Ian Wienand 0bbbe0e9b1 Update ansible-lint
I started looking at this because what I thought was an ansible-lint
bug is an ansible bug (you can't use a apostrophe in shell
comments?!...)

Anyway, the ignore numbers have changed and we don't need to enforce
pipefail.  Otherwise it found some variable typos.

[1] https://github.com/ansible/ansible/issues/28674

Change-Id: I35315c82200686841a9b1d4c87c7f27a71bd8931
2020-01-15 13:24:49 +11:00
James E. Blair 4f39642446 Update zuul ansible location
With multi-ansible support, the location of the zuul plugins/modules
has moved.

Change-Id: I8e2cf1f2276bca5a912fed52062628b3b9d0d6d9
2019-03-18 10:13:06 -07:00
Paul Belanger 3a34c2b0ab Set ANSIBLE_ACTION_PLUGINS for linters
The zuul_return plugin was recently converted to an action plugin, make
sure we also export that path for ansible-lint.

Change-Id: I775e902f3c9f72c655b94b71293565e3e044d15c
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2019-01-18 17:47:13 -05:00
Monty Taylor d07d6d65ef
Add zuul to test-requirements for linting
The linters env is picking up zuul-jobs content too, so we need to add
zuul to get the zuul_ modules ... otherwise ansible-lint has a sad.

Add zuul to test-requirements like is done in zuul-jobs. Then point the
library path to zuul/ansible/library in the site-packages dir from tox
so that we pick up the right files.

Change-Id: I7a4f0159290d67354e0a73365091a0d1718762fd
2018-10-18 10:40:00 -05:00
Vu Cong Tuan 64d242747f Remove testr
We're not using testr or stestr anywhere in this project,
this environment is unused.
Therefore, we should remove testr completely.

Change-Id: I50cf179487f3bea69e57d3a0ab2be4eb6b65423d
2018-07-11 08:08:59 +07:00
Colleen Murphy 665704e3dc Fix ansible-lint job
The ansible-linter was only running on playbooks, not on roles. This
patch corrects the tox environment to ensure that roles are linted.

Since roles weren't being linted, some errors had sneaked through. This
patch also corrects an unnamed task and disables linting of a task that
deliberately uses the shell module.

Also fix a comment in the tox file that was referencing a non-existent
zuul job.

Change-Id: I5b1ca3947e80588ab0cc8d3632f1292fc707aac1
2018-03-28 23:24:07 +02:00
Paul Belanger f769c9d0f4 Create openstack-zuul-jobs-linters jobs
This will be a cross repo linter jobs for openstack-zuul-jobs,
project-config and zuul-jobs.

Each repo will be able to run this job, which sets up all our projects
roles in the correct locations.

Depends-On: I59e5d41a9539671ee5aab9b9036379eb9101d021
Change-Id: I16186c929e7d0e6e34b35271559e555255a52b00
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-10-24 06:37:20 +00:00
Monty Taylor 33b820a035
Remove spurious change to tox.ini
This snuck in while debugging something else.

Change-Id: I2cdb619f420583fbdb75ae9b356f7badc7d22099
2017-09-29 15:24:51 -05:00
Monty Taylor 2c2f0e11cc
Update ubuntu-xenial-2-node to match centos-7-2-node
In the other places subnodes is a group and there is a node called
secondary put in to it. It shouldn't matter, but as centos-7-2-node and
ubuntu-xenial-2-node are defined differently it could cause someone to
be confused or think there is a reason for the divergence.

Change-Id: Icd28da7c1c20b605841cd27f4f656e4b8f812fee
2017-09-29 11:43:34 -05:00
Monty Taylor bf16abfd7c
Stop running ansible-lint on playbooks
It can't handle the following form:

  shell:
    cmd: |
      something

Which is both valid and required.

Change-Id: I14896450b16f8e65128804b44a643da63580812d
2017-09-28 14:38:29 -05:00
Jesse Keating a85b54e08d Remove gratuitous use of xargs
Find can do the thing we want it to do without involving xargs. The
-exec {} + construct will put all the found files into one long set of
arguments (up to the limit, at which point additional commands will be
constructed). Failures of exec will result in nonzero return of find.

Change-Id: I4427a259df29c3f31581c7452cd0cf5e1bc78416
Signed-off-by: Jesse Keating <omgjlk@us.ibm.com>
2017-09-27 11:32:00 -07:00
James E. Blair 94833e22d2 Run ansible-list on all playbooks simultaneously
Change-Id: I009f8bf0b66d49e78cd60f95decccf089ef46784
2017-09-26 14:25:20 -07:00
James E. Blair 1f1ef0aba8 Check all playbooks simultaneously
Change-Id: I04aa1e843cbd08a97abeb03dc55add7219358ab3
2017-09-26 14:25:18 -07:00
Monty Taylor a3139c4bb5 Migrate jobs from zuulv2 to zuulv3
This is the result of having run the zuul migration tool.

Depends-On: I72687a56285a3d733a9adeaf3dc037a1ac95efd3
Change-Id: Ib511da75908e152e72fdf0d7b496f4fa98f9c223
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-09-26 15:02:59 -04:00
Paul Belanger f67d09d315 Create publish-openstack-python(-branch)-tarball jobs
These 2 jobs will be used to copy release / branch tarballs to
tarballs.o.o.

Branch tarballs will only copy *.tar.gz, while release jobs will copy
both *.tar.gz and *.whl files.

Change-Id: Ic879302a2006b737ee4364cea067a00ebe198951
Depends-On: Ia79802dd386dbf1287af16a59985ce99a7dd4899
Depends-On: Ic7fc31a372de29a3a97ef84539faf3b0a1d6e181
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-08-10 13:19:08 -04:00
Paul Belanger 0d5c11029a Setup ANSIBLE_ROLES_PATH in tox.ini
It is possible we are going to depend on roles in other repos (like
the next patch). Move this to using an environmental variable to make
it easier to depend on external roles.

Change-Id: Ia90ac5674188d38a6a749c92de957430d5a5403c
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-08-07 16:15:11 -04:00
Paul Belanger dc767038eb Set basepython to python3
We are running zuulv3 under python3, so it make sense to ensure
ansible dependencies are also testing with python3.

Change-Id: I2d011d62c1d5192c0f309e37c2d30c8598cce359
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-08-07 16:13:30 -04:00
Paul Belanger 1d265e48f6
Rename pep8 to linters for tox
Using linters makes more sense, for playbooks / roles. Make the
switch.

Change-Id: Ib5a4f7409276aa832783f1d217530b5249313611
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-07-17 13:18:21 -04:00
Paul Belanger ea35d7ffc9
Include ansible-playbook syntax-check for tox pep8
Syntax check our playbooks / roles when we run pep8. This way we can
quickly tests if our playbooks are valid.

Change-Id: I2f4e3f617922c8578adb53e2c4a418488fcf230b
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-07-17 13:18:19 -04:00
Paul Belanger c0c9653ab5
Ensure we load roles for linting
Did didn't have ansible-lint setup properly, as a results our roles
weren't actually linted properly.

Switch run-docs to command task, since we are not using any shell
variables.

Ignore ANSIBLE0012 for now.

Change-Id: Id184f7eb5dd67117e7dde9c8eb38a3a8af9dd892
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-07-17 13:18:17 -04:00
Paul Belanger c913d42c39
Run ansible-lint under pep8 envlist
Start linting our ansible playbooks, this is helpful to find basic
syntax / formatting errors.

Change-Id: I147a303841ac70ee59177c56d24758e73c04205b
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-05-22 16:50:20 -04:00
Paul Belanger 2fe384f6cb
Remove tox -epy27 envlist
We currently don't have python things to test.

Change-Id: Ie4490ce222d4212bf941c123766aacfc5b1b9281
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-05-22 16:44:48 -04:00
Paul Belanger 5ca3b67305
Initial commit for docs
Start creating the structure needed to run tox-docs on our project.

Change-Id: Ia9431073189be91fbfdd36fa0781e4bd504adedb
Depends-On: I5999b95cd1e8140118ed65cd35ff87931da79d52
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-05-19 17:03:53 -04:00
Paul Belanger c5e55d75b3
Import playbooks from feature/zuulv3 development
We have been using the following ansible playbooks for testing
feature/zuulv3 of zuul.  This commit copies the playbooks from zuul
and imports them here.

Change-Id: Ib776cdce10b1f05501c46f6cf359723960f1bc71
Depends-On: I11da723df8823091f25e2a630e80ee4270d99a9b
Depends-On: Ic03634dd02d2eb1fa5aa8a38f4beb5f0ec5582c6
Co-Authored-By: Andreas Jaeger <aj@suse.com>
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-05-04 15:56:32 -04:00