Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Molecule converge with specific scenario ends up with an error #4179

Closed
7 tasks done
ep4sh opened this issue May 8, 2024 · 1 comment
Closed
7 tasks done

Molecule converge with specific scenario ends up with an error #4179

ep4sh opened this issue May 8, 2024 · 1 comment
Labels

Comments

@ep4sh
Copy link

ep4sh commented May 8, 2024

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 24.2.1 using python 3.12 
    ansible:2.16.6
    azure:23.5.3 from molecule_plugins
    containers:23.5.3 from molecule_plugins requiring collections: ansible.posix>=1.3.0 community.docker>=1.9.1 containers.podman>=1.8.1
    default:24.2.1 from molecule
    docker:23.5.3 from molecule_plugins requiring collections: community.docker>=3.4.11 ansible.posix>=1.4.0
    ec2:23.5.3 from molecule_plugins
    gce:23.5.3 from molecule_plugins requiring collections: google.cloud>=1.0.2 community.crypto>=1.8.0
    openstack:23.5.3 from molecule_plugins requiring collections: openstack.cloud>=2.1.0
    podman:23.5.3 from molecule_plugins requiring collections: containers.podman>=1.7.0 ansible.posix>=1.3.0
    vagrant:23.5.3 from molecule_plugins

What happened

running molecule converge -s os-repo ends with error

Expectation: no errors with different run on test suite (scenario)

Reproducing example

(venv)  ranger (main) ✗ molecule init scenario os-repo
INFO     Initializing new scenario os-repo...

PLAY [Create a new molecule scenario] ******************************************

TASK [Check if destination folder exists] **************************************
changed: [localhost]

TASK [Check if destination folder is empty] ************************************
ok: [localhost]

TASK [Fail if destination folder is not empty] *********************************
skipping: [localhost]

TASK [Expand templates] ********************************************************
changed: [localhost] => (item=molecule/os-repo/create.yml)
changed: [localhost] => (item=molecule/os-repo/molecule.yml)
changed: [localhost] => (item=molecule/os-repo/converge.yml)
changed: [localhost] => (item=molecule/os-repo/destroy.yml)

PLAY RECAP *********************************************************************
localhost                  : ok=3    changed=2    unreachable=0    failed=0    skipped=1    rescued=0    ignored=0

INFO     Initialized scenario in /home/pradchenko/wmx/tests/ranger/molecule/os-repo successfully.

Runs as expected.

Then change desired role name:

(venv)  ranger (main) ✗ cat molecule/os-repo/converge.yml 
---

- hosts: all
  become: yes
  gather_facts: true
  any_errors_fatal: true
  roles:
    - ranger

Then change desired platform:

(venv)  ranger (main) ✗ cat molecule/os-repo/molecule.yml 
---

scenario:
  name: os-repo

driver:
  name: docker

dependency:
  name: galaxy

platforms:
  - name: buster
    image:<private_docker_regsitry>/buster:systemd
    pre_build_image: true
    volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup:rw
    tmpfs:
      - /run
    cgroupns_mode: host
    privileged: true
    tty: true
    command: "/sbin/init"

provisioner:
  name: ansible
  options:
    diff: True
    v: True

verifier:
  name: ansible
lint: 
  ansible-lint .
scenario:
  name: default

tree molecule path:

(venv)  ranger (main) ✗ tree molecule 
molecule
├── default
│   ├── converge.yml
│   └── molecule.yml
├── os-repo
│   ├── converge.yml
│   └── molecule.yml
├── stable
│   ├── converge.yml
│   └── molecule.yml
└── tests
    └── test_nginx_common.py

Run converge:

(venv)  ranger (main) ✗ molecule converge -s os-repo
WARNING  Driver docker does not provide a schema.
CRITICAL Scenario 'os-repo' not found.  Exiting.

thanks!

@ep4sh ep4sh added the new label May 8, 2024
@ep4sh
Copy link
Author

ep4sh commented May 13, 2024

After scenario re-initialization and entire cache cleanup: rm -rf ~/.cache/molecule, I was able to use different scenarios.

@ep4sh ep4sh closed this as completed May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

1 participant