Skip to content

Commit

Permalink
ci: Use supported ansible-lint action; run ansible-lint against the c…
Browse files Browse the repository at this point in the history
…ollection

The old ansible-community ansible-lint is deprecated.  There is a
new ansible-lint github action.  The new ansible-lint has several checks
related to ansible-test and the ignore files.  Many of our ignore settings
are not allowed any more and are required to be fixed or addressed in the
Ansible preferred way.

The python imports have to be wrapped in a try/except ImportError, and
where possible, an error must be returned from the module explaining
what was not able to be imported.

The result of this is that the .sanity files can be reduced to the
bare minimum which will greatly reduce the maintenance burden of
those files, make it easier to support newer versions of Ansible,
and make it easier to import the system roles collection into Galaxy
and Automation Hub.

`distutils.version` is deprecated, and it is a hard error in python 3.12
Instead, use `packaging.version` - unfortunately, this means having to
add a dependency on `python3-packaging` on platforms that support it -
notably, there is no python-packaging available on EL7, so fall back
to using `distutils.version` there.

The latest Ansible repo gating tests run ansible-lint against
the collection format instead of against individual roles.
We have to convert the role to collection format before running
ansible-test.

Role developers can run this locally using
`tox -e collection,ansible-lint-collection`
See linux-system-roles/tox-lsr#125

Add `---` doc start to .markdownlint.yaml

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
  • Loading branch information
richm committed Jan 6, 2024
1 parent 4f50fa1 commit 7a1fb24
Show file tree
Hide file tree
Showing 20 changed files with 185 additions and 266 deletions.
1 change: 1 addition & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# Default state for all rules
default: true

Expand Down
1 change: 1 addition & 0 deletions .ostree/packages-runtime-CentOS-9.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
python3-cryptography
python3-dbus
python3-packaging
python3-pyasn1
1 change: 1 addition & 0 deletions .ostree/packages-runtime-Fedora.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
python3-cryptography
python3-dbus
python3-packaging
python3-pyasn1
1 change: 1 addition & 0 deletions .ostree/packages-runtime-RedHat-9.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
python3-cryptography
python3-dbus
python3-packaging
python3-pyasn1
25 changes: 0 additions & 25 deletions .sanity-ansible-ignore-2.10.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1 @@
plugins/module_utils/certificate_lsr/providers/base.py import-2.6!skip
plugins/module_utils/certificate_lsr/providers/base.py import-2.7!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.5!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.6!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.7!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.8!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-2.6!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-2.7!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.5!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.6!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.7!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.8!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-2.6!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-2.7!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.5!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.6!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.7!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.8!skip
plugins/modules/certificate_request.py import-2.6!skip
plugins/modules/certificate_request.py import-2.7!skip
plugins/modules/certificate_request.py import-3.5!skip
plugins/modules/certificate_request.py import-3.6!skip
plugins/modules/certificate_request.py import-3.7!skip
plugins/modules/certificate_request.py import-3.8!skip
plugins/modules/certificate_request.py validate-modules:missing-gplv3-license
plugins/modules/certificate_request.py validate-modules:import-error
30 changes: 0 additions & 30 deletions .sanity-ansible-ignore-2.11.txt
Original file line number Diff line number Diff line change
@@ -1,31 +1 @@
plugins/module_utils/certificate_lsr/providers/base.py compile-2.6!skip
plugins/module_utils/certificate_lsr/providers/base.py import-2.6!skip
plugins/module_utils/certificate_lsr/providers/base.py import-2.7!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.5!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.6!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.7!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.8!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.9!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-2.6!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-2.7!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.5!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.6!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.7!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.8!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.9!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-2.6!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-2.7!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.5!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.6!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.7!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.8!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.9!skip
plugins/modules/certificate_request.py import-2.6!skip
plugins/modules/certificate_request.py import-2.7!skip
plugins/modules/certificate_request.py import-3.5!skip
plugins/modules/certificate_request.py import-3.6!skip
plugins/modules/certificate_request.py import-3.7!skip
plugins/modules/certificate_request.py import-3.8!skip
plugins/modules/certificate_request.py import-3.9!skip
plugins/modules/certificate_request.py validate-modules:missing-gplv3-license
plugins/modules/certificate_request.py validate-modules:import-error
34 changes: 0 additions & 34 deletions .sanity-ansible-ignore-2.12.txt
Original file line number Diff line number Diff line change
@@ -1,35 +1 @@
plugins/module_utils/certificate_lsr/providers/base.py compile-2.6!skip
plugins/module_utils/certificate_lsr/providers/base.py import-2.6!skip
plugins/module_utils/certificate_lsr/providers/base.py import-2.7!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.5!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.6!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.7!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.8!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.9!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.10!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-2.6!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-2.7!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.5!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.6!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.7!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.8!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.9!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.10!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-2.6!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-2.7!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.5!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.6!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.7!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.8!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.9!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.10!skip
plugins/modules/certificate_request.py import-2.6!skip
plugins/modules/certificate_request.py import-2.7!skip
plugins/modules/certificate_request.py import-3.5!skip
plugins/modules/certificate_request.py import-3.6!skip
plugins/modules/certificate_request.py import-3.7!skip
plugins/modules/certificate_request.py import-3.8!skip
plugins/modules/certificate_request.py import-3.9!skip
plugins/modules/certificate_request.py import-3.10!skip
plugins/modules/certificate_request.py validate-modules:missing-gplv3-license
plugins/modules/certificate_request.py validate-modules:import-error
34 changes: 0 additions & 34 deletions .sanity-ansible-ignore-2.13.txt
Original file line number Diff line number Diff line change
@@ -1,35 +1 @@
plugins/module_utils/certificate_lsr/providers/base.py compile-2.6!skip
plugins/module_utils/certificate_lsr/providers/base.py import-2.6!skip
plugins/module_utils/certificate_lsr/providers/base.py import-2.7!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.5!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.6!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.7!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.8!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.9!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.10!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-2.6!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-2.7!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.5!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.6!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.7!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.8!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.9!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.10!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-2.6!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-2.7!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.5!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.6!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.7!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.8!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.9!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.10!skip
plugins/modules/certificate_request.py import-2.6!skip
plugins/modules/certificate_request.py import-2.7!skip
plugins/modules/certificate_request.py import-3.5!skip
plugins/modules/certificate_request.py import-3.6!skip
plugins/modules/certificate_request.py import-3.7!skip
plugins/modules/certificate_request.py import-3.8!skip
plugins/modules/certificate_request.py import-3.9!skip
plugins/modules/certificate_request.py import-3.10!skip
plugins/modules/certificate_request.py validate-modules:missing-gplv3-license
plugins/modules/certificate_request.py validate-modules:import-error
33 changes: 0 additions & 33 deletions .sanity-ansible-ignore-2.14.txt
Original file line number Diff line number Diff line change
@@ -1,34 +1 @@
plugins/module_utils/certificate_lsr/providers/base.py import-2.7!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.5!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.6!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.7!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.8!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.9!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.10!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.11!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-2.7!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.5!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.6!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.7!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.8!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.9!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.10!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.11!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-2.7!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.5!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.6!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.7!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.8!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.9!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.10!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.11!skip
plugins/modules/certificate_request.py import-2.7!skip
plugins/modules/certificate_request.py import-3.5!skip
plugins/modules/certificate_request.py import-3.6!skip
plugins/modules/certificate_request.py import-3.7!skip
plugins/modules/certificate_request.py import-3.8!skip
plugins/modules/certificate_request.py import-3.9!skip
plugins/modules/certificate_request.py import-3.10!skip
plugins/modules/certificate_request.py import-3.11!skip
plugins/modules/certificate_request.py validate-modules:missing-gplv3-license
plugins/modules/certificate_request.py validate-modules:import-error
33 changes: 0 additions & 33 deletions .sanity-ansible-ignore-2.15.txt
Original file line number Diff line number Diff line change
@@ -1,34 +1 @@
plugins/module_utils/certificate_lsr/providers/base.py import-2.7!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.5!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.6!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.7!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.8!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.9!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.10!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.11!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-2.7!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.5!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.6!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.7!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.8!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.9!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.10!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.11!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-2.7!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.5!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.6!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.7!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.8!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.9!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.10!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.11!skip
plugins/modules/certificate_request.py import-2.7!skip
plugins/modules/certificate_request.py import-3.5!skip
plugins/modules/certificate_request.py import-3.6!skip
plugins/modules/certificate_request.py import-3.7!skip
plugins/modules/certificate_request.py import-3.8!skip
plugins/modules/certificate_request.py import-3.9!skip
plugins/modules/certificate_request.py import-3.10!skip
plugins/modules/certificate_request.py import-3.11!skip
plugins/modules/certificate_request.py validate-modules:missing-gplv3-license
plugins/modules/certificate_request.py validate-modules:import-error
1 change: 1 addition & 0 deletions .sanity-ansible-ignore-2.16.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
plugins/modules/certificate_request.py validate-modules:missing-gplv3-license
26 changes: 0 additions & 26 deletions .sanity-ansible-ignore-2.9.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1 @@
plugins/module_utils/certificate_lsr/providers/base.py compile-2.6!skip
plugins/module_utils/certificate_lsr/providers/base.py import-2.6!skip
plugins/module_utils/certificate_lsr/providers/base.py import-2.7!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.5!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.6!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.7!skip
plugins/module_utils/certificate_lsr/providers/base.py import-3.8!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-2.6!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-2.7!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.5!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.6!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.7!skip
plugins/module_utils/certificate_lsr/providers/certmonger.py import-3.8!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-2.6!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-2.7!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.5!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.6!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.7!skip
plugins/module_utils/certificate_lsr/providers/providers.py import-3.8!skip
plugins/modules/certificate_request.py import-2.6!skip
plugins/modules/certificate_request.py import-2.7!skip
plugins/modules/certificate_request.py import-3.5!skip
plugins/modules/certificate_request.py import-3.6!skip
plugins/modules/certificate_request.py import-3.7!skip
plugins/modules/certificate_request.py import-3.8!skip
plugins/modules/certificate_request.py validate-modules:missing-gplv3-license
plugins/modules/certificate_request.py validate-modules:import-error
Loading

0 comments on commit 7a1fb24

Please sign in to comment.