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 instance inherits all groups from inventory #4150

Open
4 of 7 tasks
Nebucatnetzer opened this issue Mar 15, 2024 · 0 comments
Open
4 of 7 tasks

Molecule instance inherits all groups from inventory #4150

Nebucatnetzer opened this issue Mar 15, 2024 · 0 comments
Labels

Comments

@Nebucatnetzer
Copy link

Nebucatnetzer commented Mar 15, 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.0 using python 3.10
    ansible:2.16.2
    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.0 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

I have the following base-config, I expect it to just use the hosts in the inventory files for variable lookup and the instance having the molecule group assigned.

However for some reason the instance inherited all groups from the inventory, despite not even being mentioned in those files.
We have multiple inventory files split into development, integration and production and for molecule tests I might need any of the hosts present in those files to test the various paths a role can take.

---
driver:
  name: podman
role_name_check: 1
platforms:
  - name: instance
    image: quay.io/ansible/ubuntu2204-test-container:main
    command: /sbin/init
    capabilities:
      - SYS_ADMIN
    volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    groups:
      - molecule
provisioner:
  name: ansible
  inventory:
    links:
      hosts: "../../../../inventories/"
      group_vars: "../../../../inventories/group_vars"
      host_vars: "../../../../inventories/host_vars"

Reproducing example

No response

@audgirka audgirka added bug and removed new labels Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Roadmap
Development

No branches or pull requests

2 participants