# Ansible-native inventory fails with list and login

**URL:** <https://forum.ansible.com/t/ansible-native-inventory-fails-with-list-and-login/45034>\
**Category:** Get Help\
**Tags:** molecule6, galaxy-ng\
**Created:** [December 29, 2025, 1:38pm UTC](https://forum.ansible.com/t/ansible-native-inventory-fails-with-list-and-login/45034 "2025-12-29T13:38:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jochen\_Maes](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jochen_maes/32/8029_2.png) [@Jochen\_Maes](https://forum.ansible.com/u/Jochen_Maes)\
**Post date:** [December 29, 2025, 1:38pm UTC](https://forum.ansible.com/t/ansible-native-inventory-fails-with-list-and-login/45034/1 "2025-12-29T13:38:22Z")

</div>

I am trying to get molecule-plugins[podman] working with ansible-native inventory.

molecule.yml:

```yaml
---
ansible:
  cfg:
    defaults:
      deprecation_warnings: false
      host_key_checking: false
  env:
    ANSIBLE_ROLES_PATH: ../../../playbooks/roles
    ANSIBLE_INVENTORY: inventory/

  executor:
    args:
      ansible_playbook:
        - --inventory=inventory/
dependency:
  name: galaxy
  options:
    requirements-file: ${MOLECULE_SCENARIO_DIRECTORY}/requirements.yml

scenario:
  test_sequence:
    - dependency
    - destroy
    - create
    - converge
    - idempotence
    - verify
    - cleanup
    - destroy

```

hostsfile:

```shell
---
all:
  children:
    molecule:
      hosts:
        molecule-ubuntu2404:
          container_image: docker.io/geerlingguy/docker-ubuntu2404-ansible
          ansible_connection: podman
        molecule-ubuntu2204:
          container_image: docker.io/geerlingguy/docker-ubuntu2204-ansible
          container_command: sleep 1d
          container_privileged: false
          ansible_connection: podman

```

The create/converge/… all works however list and login fails.  
podman ps and List shows following:

```auto
⭐❯ podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9e8ceadf39dd docker.io/geerlingguy/docker-ubuntu2404-ansible:latest sleep 1d 11 days ago Up 34 minutes molecule-ubuntu2404
d79b3ff0e793 docker.io/geerlingguy/docker-ubuntu2204-ansible:latest sleep 1d 11 days ago Up 34 minutes molecule-ubuntu2204
⭐❯ molecule list -s default
INFO default ➜ list: Executing
INFO default ➜ list: Executed: Successful
                ╷ ╷ ╷ ╷ ╷            
  Instance Name │ Driver Name │ Provisioner Name │ Scenario Name │ Created │ Converged  
╶───────────────┼─────────────┼──────────────────┼───────────────┼─────────┼───────────╴
                │ default │ ansible │ default │ true │ false      
                ╵ ╵ ╵ ╵ ╵            

```

molecule login shows following:

```auto
⭐❯ molecule login -s default -h molecule-ubuntu2404
INFO default ➜ login: Executing
ERROR Unable to find host 'molecule-ubuntu2404'.
For more information: https://docs.ansible.com/projects/molecule/usage/#molecule-login

```

Am I missing elements? Am I doing anything wrong?

---

<div class="post-metadata">

**Author:** ![hanfried](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/hanfried/32/10153_2.png) [@hanfried](https://forum.ansible.com/u/hanfried)\
**Post date:** [January 21, 2026, 6:28pm UTC](https://forum.ansible.com/t/ansible-native-inventory-fails-with-list-and-login/45034/2 "2026-01-21T18:28:16Z")

</div>

I had the same problem and decided after long while to systematically reverse engineer the problem.

If you put a debugger to this line: [molecule/src/molecule/command/login.py at 1cbcd4f68d35957ee3de41b5b27992b85d1d6050 · ansible/molecule · GitHub](https://github.com/ansible/molecule/blob/1cbcd4f68d35957ee3de41b5b27992b85d1d6050/src/molecule/command/login.py#L65)

you’ll see that it is looking to self.\_config.platforms.instances  
and that’s how ansible molecule is figuring out which instances do exist that it could login.

So, it’s not doing a live lookup vs podman nor a lookup into your inventory.  
It’s just a configuration like in the example for docker [Using docker containers - Ansible Molecule](https://docs.ansible.com/projects/molecule/examples/docker/) that seems to be forgotten in the documentation for podman.

I added to my molecule/default-podman/molecule.yml now these lines:

platforms:

- name: molecule-fedora  
image: ghcr . io /ansible/community-ansible-dev-tools:latest # remove whitespace (is detected as url and there’s a limit for anything looking like a url)

for the example of podman from the documentation and now the login works.

You probably would have to adopt it to something like (untested):

platforms

- name: molecule-ubuntu2404  
image: docker . io / geerlingguy/docker-ubuntu2404-ansible # remove whitespaces
- name: molecule-ubuntu2204  
image: docker . io/geerlingguy/docker-ubuntu2204-ansible # remove whitespaces

Quite tricky and I knew why I tested it before starting my new work 🙂  
The whole documentation seems to be inconsistent and in addition pretty much all tutorials also don’t work out of the box with current ansible / molecule variations. (If you take older versions from several years ago, it seems to work, even though I don’t see a change regarding the source code in the last 6 years). But I won’t investigate that.

I already got paranoid whether it’s a RHEL move similar to what Microslop loves to do, because I only tested it so far from control hosts with debian / ubuntu.

The strange thing also is that molecule init doesn’t create the platforms configuration either.  
Without debugging on patching the libraries in my venv I would not have found that.

Can we really trust to use this for production if it works that subtle?  
Anyway, I hope it helps you and maybe the next poor guy who runs into this topic.
