Skip to content

Working directory from .config/molecule/config.yml is unstable #4596

@felinira

Description

@felinira

Prerequisites

  • This was not already reported in the past (duplicate check)
  • It does reproduce it with code from main branch (latest unreleased version)
  • I include a minimal example for reproducing the bug
  • The bug is not trivial, as for those a direct pull-request is preferred
  • Running pip check does not report any conflicts
  • I was able to reproduce the issue on a different machine
  • The issue is not specific to any driver other than 'default' one

Environment

INFO Found config file /home/x/ansible-repo/.config/molecule/config.yml
molecule 25.12.0 using python 3.12
ansible:2.19.5
default:25.12.0 from molecule

What happened

Including shared playbooks from a .config/molecule/config.yml file (such as create.yml) sets the current path to the executing scenario's directory, and not to .config/molecule. I would have expected to be able to refer to files relative to the current file, eg in .config/molecule.

Trying to mitigate that, there is also no environment variable that can be used to create stable paths relative to the VCS root.

With new ansible-native configuration it would be very useful to share instance creation playbooks between all collections and scenarios in a monorepo. For all I know this behaviour makes this endeavour impossible.

Reproducing example

# .config/molecule/config.yml
---
ansible:
  executor:
    backend: ansible-playbook
  playbooks:
    create: create.yml

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions