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 module documentation must comply with the Ansible standards.  One
aspect of this is the `version_added` must be a valid ansible-core
version in X.Y.Z format.  Note that this version isn't really used
anywhere, so it doesn't matter for users of the role, it is purely
an `ansible-test` and import gating issue.

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.

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

The file tests/integration/conftest.py is no longer used.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
  • Loading branch information
richm committed Dec 14, 2023
1 parent e213dc9 commit 7b1a52e
Show file tree
Hide file tree
Showing 13 changed files with 107 additions and 442 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
72 changes: 1 addition & 71 deletions .sanity-ansible-ignore-2.11.txt
Original file line number Diff line number Diff line change
@@ -1,73 +1,3 @@
plugins/module_utils/network_lsr/nm/__init__.py empty-init!skip
plugins/module_utils/network_lsr/nm/__init__.py import-2.6!skip
plugins/module_utils/network_lsr/nm/__init__.py import-2.7!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.5!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.6!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.7!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.8!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.9!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.10!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-2.6!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-2.7!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.5!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.6!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.7!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.8!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.9!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.10!skip
plugins/module_utils/network_lsr/nm/client.py import-2.6!skip
plugins/module_utils/network_lsr/nm/client.py import-2.7!skip
plugins/module_utils/network_lsr/nm/client.py import-3.5!skip
plugins/module_utils/network_lsr/nm/client.py import-3.6!skip
plugins/module_utils/network_lsr/nm/client.py import-3.7!skip
plugins/module_utils/network_lsr/nm/client.py import-3.8!skip
plugins/module_utils/network_lsr/nm/client.py import-3.9!skip
plugins/module_utils/network_lsr/nm/client.py import-3.10!skip
plugins/module_utils/network_lsr/nm/connection.py import-2.6!skip
plugins/module_utils/network_lsr/nm/connection.py import-2.7!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.5!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.6!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.7!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.8!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.9!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.10!skip
plugins/module_utils/network_lsr/nm/error.py import-2.6!skip
plugins/module_utils/network_lsr/nm/error.py import-2.7!skip
plugins/module_utils/network_lsr/nm/error.py import-3.5!skip
plugins/module_utils/network_lsr/nm/error.py import-3.6!skip
plugins/module_utils/network_lsr/nm/error.py import-3.7!skip
plugins/module_utils/network_lsr/nm/error.py import-3.8!skip
plugins/module_utils/network_lsr/nm/error.py import-3.9!skip
plugins/module_utils/network_lsr/nm/error.py import-3.10!skip
plugins/module_utils/network_lsr/nm/provider.py import-2.6!skip
plugins/module_utils/network_lsr/nm/provider.py import-2.7!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.5!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.6!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.7!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.8!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.9!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.10!skip
plugins/modules/network_connections.py validate-modules:doc-default-does-not-match-spec
plugins/modules/network_connections.py validate-modules:doc-required-mismatch
plugins/modules/network_connections.py validate-modules:missing-examples
plugins/modules/network_connections.py validate-modules:missing-gplv3-license
plugins/modules/network_connections.py validate-modules:module-invalid-version-added
plugins/modules/network_connections.py validate-modules:no-default-for-required-parameter
plugins/modules/network_connections.py validate-modules:parameter-list-no-elements
plugins/modules/network_connections.py validate-modules:parameter-type-not-in-doc
plugins/modules/network_connections.py validate-modules:undocumented-parameter
tests/network/ensure_provider_tests.py compile-2.6!skip
tests/network/ensure_provider_tests.py compile-2.7!skip
tests/network/ensure_provider_tests.py compile-3.5!skip
tests/network/ensure_provider_tests.py future-import-boilerplate!skip
tests/network/ensure_provider_tests.py metaclass-boilerplate!skip
plugins/modules/network_state.py validate-modules:missing-gplv3-license
tests/network/ensure_provider_tests.py shebang!skip
tests/network/integration/conftest.py future-import-boilerplate!skip
tests/network/integration/conftest.py metaclass-boilerplate!skip
tests/network/integration/test_ethernet.py future-import-boilerplate!skip
tests/network/integration/test_ethernet.py metaclass-boilerplate!skip
tests/network/merge_coverage.sh shebang!skip
tests/network/unit/test_network_connections.py future-import-boilerplate!skip
tests/network/unit/test_network_connections.py metaclass-boilerplate!skip
tests/network/unit/test_nm_provider.py future-import-boilerplate!skip
tests/network/unit/test_nm_provider.py metaclass-boilerplate!skip
69 changes: 0 additions & 69 deletions .sanity-ansible-ignore-2.12.txt
Original file line number Diff line number Diff line change
@@ -1,72 +1,3 @@
plugins/module_utils/network_lsr/nm/__init__.py empty-init!skip
plugins/module_utils/network_lsr/nm/__init__.py import-2.6!skip
plugins/module_utils/network_lsr/nm/__init__.py import-2.7!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.5!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.6!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.7!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.8!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.9!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.10!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-2.6!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-2.7!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.5!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.6!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.7!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.8!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.9!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.10!skip
plugins/module_utils/network_lsr/nm/client.py import-2.6!skip
plugins/module_utils/network_lsr/nm/client.py import-2.7!skip
plugins/module_utils/network_lsr/nm/client.py import-3.5!skip
plugins/module_utils/network_lsr/nm/client.py import-3.6!skip
plugins/module_utils/network_lsr/nm/client.py import-3.7!skip
plugins/module_utils/network_lsr/nm/client.py import-3.8!skip
plugins/module_utils/network_lsr/nm/client.py import-3.9!skip
plugins/module_utils/network_lsr/nm/client.py import-3.10!skip
plugins/module_utils/network_lsr/nm/connection.py import-2.6!skip
plugins/module_utils/network_lsr/nm/connection.py import-2.7!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.5!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.6!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.7!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.8!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.9!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.10!skip
plugins/module_utils/network_lsr/nm/error.py import-2.6!skip
plugins/module_utils/network_lsr/nm/error.py import-2.7!skip
plugins/module_utils/network_lsr/nm/error.py import-3.5!skip
plugins/module_utils/network_lsr/nm/error.py import-3.6!skip
plugins/module_utils/network_lsr/nm/error.py import-3.7!skip
plugins/module_utils/network_lsr/nm/error.py import-3.8!skip
plugins/module_utils/network_lsr/nm/error.py import-3.9!skip
plugins/module_utils/network_lsr/nm/error.py import-3.10!skip
plugins/module_utils/network_lsr/nm/provider.py import-2.6!skip
plugins/module_utils/network_lsr/nm/provider.py import-2.7!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.5!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.6!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.7!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.8!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.9!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.10!skip
plugins/modules/network_connections.py validate-modules:doc-default-does-not-match-spec
plugins/modules/network_connections.py validate-modules:doc-required-mismatch
plugins/modules/network_connections.py validate-modules:missing-examples
plugins/modules/network_connections.py validate-modules:missing-gplv3-license
plugins/modules/network_connections.py validate-modules:module-invalid-version-added
plugins/modules/network_connections.py validate-modules:no-default-for-required-parameter
plugins/modules/network_connections.py validate-modules:parameter-list-no-elements
plugins/modules/network_connections.py validate-modules:parameter-type-not-in-doc
plugins/modules/network_connections.py validate-modules:undocumented-parameter
plugins/modules/network_state.py import-2.6!skip
plugins/modules/network_state.py import-2.7!skip
plugins/modules/network_state.py import-3.5!skip
plugins/modules/network_state.py import-3.6!skip
plugins/modules/network_state.py import-3.7!skip
plugins/modules/network_state.py import-3.8!skip
plugins/modules/network_state.py import-3.9!skip
plugins/modules/network_state.py import-3.10!skip
plugins/modules/network_state.py validate-modules:import-error
plugins/modules/network_state.py validate-modules:missing-examples
plugins/modules/network_state.py validate-modules:missing-gplv3-license
plugins/modules/network_state.py validate-modules:module-invalid-version-added
tests/network/ensure_provider_tests.py shebang!skip
tests/network/merge_coverage.sh shebang!skip
69 changes: 0 additions & 69 deletions .sanity-ansible-ignore-2.13.txt
Original file line number Diff line number Diff line change
@@ -1,72 +1,3 @@
plugins/module_utils/network_lsr/nm/__init__.py empty-init!skip
plugins/module_utils/network_lsr/nm/__init__.py import-2.6!skip
plugins/module_utils/network_lsr/nm/__init__.py import-2.7!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.5!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.6!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.7!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.8!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.9!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.10!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-2.6!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-2.7!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.5!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.6!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.7!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.8!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.9!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.10!skip
plugins/module_utils/network_lsr/nm/client.py import-2.6!skip
plugins/module_utils/network_lsr/nm/client.py import-2.7!skip
plugins/module_utils/network_lsr/nm/client.py import-3.5!skip
plugins/module_utils/network_lsr/nm/client.py import-3.6!skip
plugins/module_utils/network_lsr/nm/client.py import-3.7!skip
plugins/module_utils/network_lsr/nm/client.py import-3.8!skip
plugins/module_utils/network_lsr/nm/client.py import-3.9!skip
plugins/module_utils/network_lsr/nm/client.py import-3.10!skip
plugins/module_utils/network_lsr/nm/connection.py import-2.6!skip
plugins/module_utils/network_lsr/nm/connection.py import-2.7!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.5!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.6!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.7!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.8!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.9!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.10!skip
plugins/module_utils/network_lsr/nm/error.py import-2.6!skip
plugins/module_utils/network_lsr/nm/error.py import-2.7!skip
plugins/module_utils/network_lsr/nm/error.py import-3.5!skip
plugins/module_utils/network_lsr/nm/error.py import-3.6!skip
plugins/module_utils/network_lsr/nm/error.py import-3.7!skip
plugins/module_utils/network_lsr/nm/error.py import-3.8!skip
plugins/module_utils/network_lsr/nm/error.py import-3.9!skip
plugins/module_utils/network_lsr/nm/error.py import-3.10!skip
plugins/module_utils/network_lsr/nm/provider.py import-2.6!skip
plugins/module_utils/network_lsr/nm/provider.py import-2.7!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.5!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.6!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.7!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.8!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.9!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.10!skip
plugins/modules/network_connections.py validate-modules:doc-default-does-not-match-spec
plugins/modules/network_connections.py validate-modules:doc-required-mismatch
plugins/modules/network_connections.py validate-modules:missing-examples
plugins/modules/network_connections.py validate-modules:missing-gplv3-license
plugins/modules/network_connections.py validate-modules:module-invalid-version-added
plugins/modules/network_connections.py validate-modules:no-default-for-required-parameter
plugins/modules/network_connections.py validate-modules:parameter-list-no-elements
plugins/modules/network_connections.py validate-modules:parameter-type-not-in-doc
plugins/modules/network_connections.py validate-modules:undocumented-parameter
plugins/modules/network_state.py import-2.6!skip
plugins/modules/network_state.py import-2.7!skip
plugins/modules/network_state.py import-3.5!skip
plugins/modules/network_state.py import-3.6!skip
plugins/modules/network_state.py import-3.7!skip
plugins/modules/network_state.py import-3.8!skip
plugins/modules/network_state.py import-3.9!skip
plugins/modules/network_state.py import-3.10!skip
plugins/modules/network_state.py validate-modules:import-error
plugins/modules/network_state.py validate-modules:missing-examples
plugins/modules/network_state.py validate-modules:missing-gplv3-license
plugins/modules/network_state.py validate-modules:module-invalid-version-added
tests/network/ensure_provider_tests.py shebang!skip
tests/network/merge_coverage.sh shebang!skip
69 changes: 0 additions & 69 deletions .sanity-ansible-ignore-2.14.txt
Original file line number Diff line number Diff line change
@@ -1,72 +1,3 @@
plugins/module_utils/network_lsr/nm/__init__.py empty-init!skip
plugins/module_utils/network_lsr/nm/__init__.py import-2.7!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.5!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.6!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.7!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.8!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.9!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.10!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.11!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-2.7!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.5!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.6!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.7!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.8!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.9!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.10!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.11!skip
plugins/module_utils/network_lsr/nm/client.py import-2.7!skip
plugins/module_utils/network_lsr/nm/client.py import-3.5!skip
plugins/module_utils/network_lsr/nm/client.py import-3.6!skip
plugins/module_utils/network_lsr/nm/client.py import-3.7!skip
plugins/module_utils/network_lsr/nm/client.py import-3.8!skip
plugins/module_utils/network_lsr/nm/client.py import-3.9!skip
plugins/module_utils/network_lsr/nm/client.py import-3.10!skip
plugins/module_utils/network_lsr/nm/client.py import-3.11!skip
plugins/module_utils/network_lsr/nm/connection.py import-2.7!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.5!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.6!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.7!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.8!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.9!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.10!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.11!skip
plugins/module_utils/network_lsr/nm/error.py import-2.7!skip
plugins/module_utils/network_lsr/nm/error.py import-3.5!skip
plugins/module_utils/network_lsr/nm/error.py import-3.6!skip
plugins/module_utils/network_lsr/nm/error.py import-3.7!skip
plugins/module_utils/network_lsr/nm/error.py import-3.8!skip
plugins/module_utils/network_lsr/nm/error.py import-3.9!skip
plugins/module_utils/network_lsr/nm/error.py import-3.10!skip
plugins/module_utils/network_lsr/nm/error.py import-3.11!skip
plugins/module_utils/network_lsr/nm/provider.py import-2.7!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.5!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.6!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.7!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.8!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.9!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.10!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.11!skip
plugins/modules/network_connections.py validate-modules:doc-default-does-not-match-spec
plugins/modules/network_connections.py validate-modules:doc-required-mismatch
plugins/modules/network_connections.py validate-modules:missing-examples
plugins/modules/network_connections.py validate-modules:missing-gplv3-license
plugins/modules/network_connections.py validate-modules:module-invalid-version-added
plugins/modules/network_connections.py validate-modules:no-default-for-required-parameter
plugins/modules/network_connections.py validate-modules:parameter-list-no-elements
plugins/modules/network_connections.py validate-modules:parameter-type-not-in-doc
plugins/modules/network_connections.py validate-modules:undocumented-parameter
plugins/modules/network_state.py import-2.7!skip
plugins/modules/network_state.py import-3.5!skip
plugins/modules/network_state.py import-3.6!skip
plugins/modules/network_state.py import-3.7!skip
plugins/modules/network_state.py import-3.8!skip
plugins/modules/network_state.py import-3.9!skip
plugins/modules/network_state.py import-3.10!skip
plugins/modules/network_state.py import-3.11!skip
plugins/modules/network_state.py validate-modules:import-error
plugins/modules/network_state.py validate-modules:missing-examples
plugins/modules/network_state.py validate-modules:missing-gplv3-license
plugins/modules/network_state.py validate-modules:module-invalid-version-added
tests/network/ensure_provider_tests.py shebang!skip
tests/network/merge_coverage.sh shebang!skip
Loading

0 comments on commit 7b1a52e

Please sign in to comment.