Skip to content

antsibull-docs does not always use the collection_path configured in ansible #343

@ssbarnea

Description

@ssbarnea

I detected a bug where antsibull-docs collection command will ignore a collection path configured inside ansible.cfg file. Apparently current logic implemented is to only recognize the environment variables overrides but fails to ask ansible about effective collection path used, ansible-config dump being the most effective way to report it (but even ansible --version would report it)

$ ansible-config dump|grep COLLECTIONS_PATHS
COLLECTIONS_PATHS(/Volumes/code/a/ansible_collections/ansible/eda/ansible.cfg) = ['/Volumes/code/a/ansible_collections/ansible/eda/collections']

Based on my debugging the issue seems to be caused by

def _get_existing_collections_path() -> str | None:

The issue is not critical as defining ANSIBLE_COLLECTIONS_PATH=... before calling the tool can be used as a workaround for forcing it to look elsewhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions