Skip to content

Ansible-lint unable to resolve module/action #2186

@albgus

Description

@albgus

Summary

The plugin is unable to resolve dependencies and roles, which generates errors in all playbooks referencing anything other than ansible.builtin.. Instead returning an error like:
couldn't resolve module/action 'community.general.terraform'. This often indicates a misspelling, missing collection, or incorrect module path.ansible-lint[syntax-check[unknown-module]](https://ansible.readthedocs.io/projects/lint/rules/syntax-check/)

I have a directory structure that looks roughly like this.

.
├── files/
├── galaxy_content/
├── group_vars/
├── inventory/
├── playbooks
│   ├── files -> ../files/
│   ├── group_vars -> ../group_vars/
│   ├── roles -> ../roles
│   ├── requirements.yml -> ../requirements.yml
│   └── playbooks.yml
├── roles/
├── ansible.cfg
├── README.md
├── requirements.venv.txt
└── requirements.yml

It appears that since the last update ansible-lint is no longer able to find the requirements.yml file. Even if it's linked into the playbooks directory.

Extension version

25.9.0

VS Code version

1.104.1

Ansible Version

ansible [core 2.17.2]
  config file = /Users/[REDACTED]/Documents/Code/[REDACTED]/ansible.cfg
  configured module search path = ['/Users/[REDACTED]/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/[REDACTED]/.virtualenvs/ansible-vscode/lib/python3.12/site-packages/ansible
  ansible collection location = /Users/[REDACTED]/Documents/Code/[REDACTED]/galaxy_content
  executable location = /Users/[REDACTED]/.virtualenvs/ansible-vscode/bin/ansible
  python version = 3.12.11 (main, Jun  3 2025, 15:41:47) [Clang 17.0.0 (clang-1700.0.13.3)] (/Users/[REDACTED]/.virtualenvs/ansible-vscode/bin/python)
  jinja version = 3.1.4
  libyaml = True

OS / Environment

macOS 15.7

Relevant log output

cmd 'ansible-lint --version' has the following error/warning: WARNING  Project directory /.ansible cannot be used for caching as it is not writable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions