# molecule login in docker containers using ansible native inventories

**URL:** <https://forum.ansible.com/t/molecule-login-in-docker-containers-using-ansible-native-inventories/46196>\
**Category:** Get Help\
**Tags:** docker, molecule\
**Created:** [August 20, 2026, 1:54pm UTC](https://forum.ansible.com/t/molecule-login-in-docker-containers-using-ansible-native-inventories/46196 "2026-08-20T13:54:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marauder](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@Marauder](https://forum.ansible.com/u/Marauder)\
**Post date:** [August 20, 2026, 1:54pm UTC](https://forum.ansible.com/t/molecule-login-in-docker-containers-using-ansible-native-inventories/46196/1 "2026-08-20T13:54:17Z")

</div>

I am trying to wrap my head around the ansible native inventory in molecule.  
Currently I am developing a new ansible role and wanted to use the results as template for roles that currently are still in pre-native setup.

So far I managed to translate the podman ansible native instructions over to docker and have everything working so far.

## Problem

Is `molecule login` with docker containers and ansible native inventory (currently) not possible?

`molecule login` prints the following error message:

```txt
ERROR Unable to determine connection details for instance 'container-ubuntu2604': missing 'address'.
For ansible-native scenarios, molecule login needs either an inventory entry for this host with ansible_host/ansible_user/etc. set (resolved via the same --inventory sources ansible-playbook uses), or your create playbook can write this instance's connection details to instance_config.yml (the {{ molecule_instance_config }} path).

```

As far as I understand it, I need to write the instance\_config to tell molecule how to connect to the container.  
Unfortunately everything I can find to this seems to use a ssh connection.  
The only thing I was able to find was the pre-native `login_cmd_template: "docker exec -ti {instance} bash"`

## Versions:

```shell
$ molecule --version
molecule 26.8.0 using python 3.12 
    ansible:2.21.3

```
