Skip to content

Add .ansible-lint#55

Open
alinabuzachis wants to merge 6 commits intomainfrom
asible-lint
Open

Add .ansible-lint#55
alinabuzachis wants to merge 6 commits intomainfrom
asible-lint

Conversation

@alinabuzachis
Copy link
Contributor

@alinabuzachis alinabuzachis commented Feb 24, 2026

As per https://issues.redhat.com/browse/ACA-2243, add .ansible-lint file.

Using the ansible-lint action with the @v25.1.2 version is not sufficient. It doesn't pickup the desired ansible-lint version.

- name: run-ansible-lint
   uses: ansible/ansible-lint@v25.1.2

Based on the documentation, setting override_version:v25.1.2 uses the correct version, but because of the mismatch of ansible-core version it raises:

Building ansible-lint @ git+https://github.com/ansible/ansible-lint@9cf49a01ac6b34f45aab16f0bbac1196fcd681e5

Downloading cryptography (4.3MiB)

Downloading ansible-core (2.3MiB)

Downloading black (1.7MiB)

Downloaded black

Downloaded cryptography

Downloaded ansible-core

Built ansible-lint @ git+https://github.com/ansible/ansible-lint@9cf49a01ac6b34f45aab16f0bbac1196fcd681e5

Prepared 29 packages in 607ms

Installed 30 packages in 78ms

+ ansible-compat==25.12.0

+ ansible-core==2.20.3

+ ansible-lint==25.1.2 (from git+https://github.com/ansible/ansible-lint@9cf49a01ac6b34f45aab16f0bbac1196fcd681e5)

+ attrs==25.4.0

+ black==26.1.0

+ bracex==2.6

+ cffi==2.0.0

+ click==8.3.1

+ cryptography==46.0.5

+ filelock==3.24.3

+ importlib-metadata==8.7.1

+ jinja2==3.1.6

+ jsonschema==4.26.0

+ jsonschema-specifications==2025.9.1

+ markupsafe==3.0.3

+ mypy-extensions==1.1.0

+ packaging==26.0

+ pathspec==1.0.4

+ platformdirs==4.9.2

+ pycparser==3.0

+ pytokens==0.4.1

+ pyyaml==6.0.3

+ referencing==0.37.0

+ resolvelib==1.2.1

+ rpds-py==0.30.0

+ ruamel-yaml==0.19.1

+ subprocess-tee==0.4.2

+ wcmatch==10.1

+ yamllint==1.38.0

+ zipp==3.23.0

warning: The package `ansible-lint @ git+https://github.com/ansible/ansible-lint@9cf49a01ac6b34f45aab16f0bbac1196fcd681e5` does not have an extra named `lock`

Installed 1 executable: ansible-lint

Warning: : Deprecation warnings can be disabled by setting `deprecation_warnings=False` in ansible.cfg.

[DEPRECATION WARNING]: Importing 'to_bytes' from 'ansible.module_utils._text' is deprecated. This feature will be removed from ansible-core version 2.24. Use ansible.module_utils.common.text.converters instead.

Traceback (most recent call last):

File "/home/runner/.local/bin/ansible-lint", line 4, in <module>

from ansiblelint.__main__ import _run_cli_entrypoint

File "/home/runner/.local/share/uv/tools/ansible-lint/lib/python3.14/site-packages/ansiblelint/__main__.py", line 50, in <module>

from ansiblelint import cli

File "/home/runner/.local/share/uv/tools/ansible-lint/lib/python3.14/site-packages/ansiblelint/cli.py", line 30, in <module>

from ansiblelint.yaml_utils import clean_json

File "/home/runner/.local/share/uv/tools/ansible-lint/lib/python3.14/site-packages/ansiblelint/yaml_utils.py", line 33, in <module>

from ansiblelint.utils import Task

File "/home/runner/.local/share/uv/tools/ansible-lint/lib/python3.14/site-packages/ansiblelint/utils.py", line 49, in <module>

from ansible.parsing.yaml.constructor import AnsibleConstructor, AnsibleMapping

ModuleNotFoundError: No module named 'ansible.parsing.yaml.constructor'

Error: Process completed with exit code 1.

To simplify maintenance and ensure more stable and predictable behavior, I am switching to running ansible-lint via tox.
I am also restricting the following dependency:

amazon.aws: ">=10.0.0,<12.0.0-dev0"
community.aws: ">=10.0.0,<12.0.0-dev0"

because of the known issue happening on ansbile-core 2.17.

disabled by setting deprecation_warnings=False in ansible.cfg.
ERROR! [DEPRECATED]: community.aws.waf_condition has been removed. Amazon has retired the `WAF Classic` service.  Please use the `AWS WAF (WAFv2)` service and modules instead. This feature was removed from community.aws in version 12.0.0. Please update your playbooks.
[/]

Signed-off-by: Alina Buzachis <abuzachis@redhat.com>
Signed-off-by: Alina Buzachis <abuzachis@redhat.com>
Signed-off-by: Alina Buzachis <abuzachis@redhat.com>
Signed-off-by: Alina Buzachis <abuzachis@redhat.com>
@alinabuzachis alinabuzachis force-pushed the asible-lint branch 9 times, most recently from bdd431d to ff806bc Compare February 25, 2026 16:09
Signed-off-by: Alina Buzachis <abuzachis@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant