Since role-name (106) test has been added metadata tag in
ansible-lint 5.0.9, we shouldn't exclude it explicitly.
Change-Id: I84f8a97ecce0eebf1f0fbb5c8a4fc433eedc34fd
ansible-lint 5.0.9 has merged our NoLogPasswordRule [1]
APTRepositoryCacheUpdateRule is not relevant since
ansible fix has been merged for several years now.
Also ansible-lint provides yamllint check.
This means, we shouldn't really carry custom lint
rules and can jsut use upstream ones.
We also update ansible and collections version to
match with the integrated repo.
[1] 8bef056d69
Change-Id: Ie85d6d0a17849bbc665a7f49644c38b5f6a96bb2
These must be passed as multiple invocations of -w each with a single
role code, rather than a single -w and list of rule codes.
Change-Id: I60ba3c0d7b33d74533322493820b4bc15703f77f
This will mean these do not all have to be fixed simultaneously in all
openstack-ansible role repos
Change-Id: I5336fd0c0c8c7609093c802efd957a95e006f0ad
We only need to execute the lint tests for the tests
repo, not all repositories. The path being used is
not suitable when executed in other repositories.
Change-Id: I8afbf53304ad9ac150ff6ddc3d44d256dadadd96
The custom ansible-lint rule APTRepositoryCacheUpdateRule was added in
67bfc90703, this change adds tests to
validate its functionality.
Change-Id: Ie0642cc41c016fc016b2bc6fc6d04b6afdf2be2c
Partial-bug: 1750656
In order to decouple changes in the roles repositories from changes
needed in other repositories due to the ansible-lint test, the roles
repositories will skip all dependent roles when executing the lint test.
The roles can be updated in time as patches are submitted to those
repositories. In order to do that, we need to stop symlinking the
role into the same directory where its dependent roles are and place
it to its own directory so we can ignore the dependent roles in
ansible-lint.
Change-Id: I49c01fb63054e45bae5ae45a89cce986579959de
Closes-Bug: #1737310
In order to facilitate providing additional parameters
to ansible-lint for any tests, we add an additional
environment variable for it.
We also add the printing out of any extra parameters
given to the lint test to ease troubleshooting.
Related-Bug: #1737310
Change-Id: If5746d35ee1b8ce5d6fd1a14a2abca16e29cb899
Currently the ansible-syntax and ansible-lint tests
assume the playbook to be tested against, the role
requirements file location and a single path for all
roles. This patch allows these to be modified so that
the tests can be used for the integrated repo which
does not have the same structure as the roles.
Various lint failures are no being picked up with
these modifications, so they're resolved using quick
hacks.
Change-Id: I8bea90082dbde7de49c5e2e86d298c017b16591d
This patch adds a new linter that ensures packages are being
passed as a list rather than using with_items. It also adds a
test for the new linter and adds the test to the existing linter
CI job script.
Change-Id: Iffd7284fb1c7cc41df2a4e271821e51bb274c3a3
This patch adds a new linter that ensures packages are being
passed as a list rather than using with_items. It also adds a
test for the new linter and adds the test to the existing linter
CI job script.
Change-Id: Iffd7284fb1c7cc41df2a4e271821e51bb274c3a2
Signed-off-by: Major Hayden <major@mhtx.net>
Added custom style rules checker that checks whether the
playbooks follow YAML dictionary format or not.
Guidelines for writing Ansible playbooks is located here:
http://docs.openstack.org/developer/openstack-ansible/
developer-docs/contribute.html#ansible-style-guide
Change-Id: I9ad0d90017a0ce38f97dcbd43cbe8c1c13f185ed
Closes-Bug: 1629033
This patch implements test scripts intended for use by all
OpenStack-Ansible role tests.
The intent is to simplify the role tox.ini configuration
and ensure that as many changes to role testing configuration
can be managed from the centralised tests repo instead of
individually in each repository.
This patch implements the scripts to centralise the
ansible-lint, ansible-syntax, and functional Ansible tests.
Functionality included:
- For a simple functional test, the defaults will be allow
the execution of the test without any parameters set.
- For a scenario test the scripts allow the inventory,
extra vars and any other CLI parameters for Ansible to be
set via environment variables.
- Both check mode and an idempotence test.
In addition to this functionality, the bash scripts are all
set to fail on error to ensure that tox shows a failure.
Change-Id: I23c24146485da340d4f046f80e4814652e6e3876