Skip to content

The dependency and provisioner stages execute from different locations #4426

@minsis

Description

@minsis

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

molecule 25.4.0 using python 3.13
ansible:2.18.3
azure:23.7.0 from molecule_plugins
vagrant:23.7.0 from molecule_plugins
default:25.4.0 from molecule
podman:23.7.0 from molecule_plugins requiring collections: containers.podman>=1.7.0 ansible.posix>=1.3.0
containers:23.7.0 from molecule_plugins requiring collections: ansible.posix>=1.3.0 community.docker>=1.9.1 containers.podman>=1.8.1
ec2:23.7.0 from molecule_plugins
gce:23.7.0 from molecule_plugins requiring collections: google.cloud>=1.0.2 community.crypto>=1.8.0
openstack:23.7.0 from molecule_plugins requiring collections: openstack.cloud>=2.1.0
docker:23.7.0 from molecule_plugins requiring collections: community.docker>=3.10.2 ansible.posix>=1.4.0

What happened

When referencing directories for the dependency stage they are not valid for the provisioner stage. In my example you can see I set collection-path to ../.ansible/collections but for the provision stage it has to be set to ../../../.ansible/collections

Also, even within its own execution it references different directories, as you can see with requirements-file set to ./collection.yml.

Reproducing example

dependency:
  name: "galaxy"
  options:
    force: true
    collections-path: ../.ansible/collections
    requirements-file: ./collections.yml

driver:
  name: "docker"

provisioner:
  name: "ansible"
  playbooks:
    prepare: ../default/prepare.yml
    converge: ../default/converge.yml
    verify: ../default/verify.yml
  connection_options:
    ansible_become: true
  env:
    ANSIBLE_COLLECTIONS_PATH: ../../../.ansible/collections

verifier:
  name: "ansible"

platforms:
  - name: "molecule-rhel8"
    image: registry.redhat.io/ubi8/ubi:latest
    privileged: true

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