ansible/molecule

Container drivers are not working

mrbrandao opened this issue · 0 comments

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 6.0.3 using python 3.11 
    ansible:2.16.3
    default:6.0.3 from molecule
    podman:2.0.3 from molecule_podman requiring collections: containers.podman>=1.7.0 ansible.posix>=1.3.0

What happened

  1. When using molecule init scenario -d podman the driver is not declared in the molecule.yml
  2. When running the molecule create it will create using the default driver instead, of the one specified in init command.
  3. After manually adding the driver in molecule.yml, the create and destroy plays, will still not use the declared driver, skipping all tasks. when removing the default create.yml and destroy.yml, then it will behavior as intended.

What I expect to happen?

  1. The command molecule init scenario -d podman to create the proper molecule.yml with the driver declared
  2. The command molecule create to create the container using the specified driver
  3. The command molecule destroy to destroy the running container created.

Reproducing example

python3.11 -m venv .venv
source .venv/bin/activate
pip install ansible-core molecule molecule-podman
ansible-galaxy collection init foo.example
cd foo/example/roles
ansible-galaxy role init bar
cd bar
molecule init scenario -d podman
molecule create
molecule destroy