# Molecule/docker login for multiple instance

**URL:** <https://forum.ansible.com/t/molecule-docker-login-for-multiple-instance/30347>\
**Category:** Ansible Project\
**Tags:** ansible-lint, galaxy-ng\
**Created:** [May 16, 2019, 12:38pm UTC](https://forum.ansible.com/t/molecule-docker-login-for-multiple-instance/30347 "2019-05-16T12:38:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kunalsing\_Thakur](https://avatars.discourse-cdn.com/v4/letter/k/3d9bf3/32.png) [@Kunalsing\_Thakur](https://forum.ansible.com/u/Kunalsing_Thakur)\
**Post date:** [May 16, 2019, 12:38pm UTC](https://forum.ansible.com/t/molecule-docker-login-for-multiple-instance/30347/1 "2019-05-16T12:38:38Z")

</div>

> <https://github.com/ansible/molecule/issues/2044>
>
> \# Issue Type
> 
> \- Bug report
> 
> \# Molecule and Ansible details
> \`\`\`YAML---
> depe…ndency:
> name: galaxy
> driver:
> name: docker
> lint:
> name: yamllint
> platforms:
> - name: nocon01p2
> hostname: nocon01p2.example.com
> image: centos/systemd:1.0
> pre\_build\_image: True
> privileged: True
> volumes:
> - /sys/fs/cgroup:/sys/fs/cgroup:ro
> command: "/usr/sbin/init"
> tmpfs:
> - /tmp
> - /run
> capabilities:
> - SYS\_ADMIN
> networks:
> - name: example.com
> - name: nocon02p2
> hostname: nocon01p2.example.com
> image: centos/systemd:1.0
> pre\_build\_image: True
> privileged: True
> volumes:
> - /sys/fs/cgroup:/sys/fs/cgroup:ro
> command: "/usr/sbin/init"
> tmpfs:
> - /tmp
> - /run
> capabilities:
> - SYS\_ADMIN
> networks:
> - name: example.com
> - name: nocon03p2
> hostname: nocon01p2.example.com
> image: centos/systemd:1.0
> pre\_build\_image: True
> privileged: True
> volumes:
> - /sys/fs/cgroup:/sys/fs/cgroup:ro
> command: "/usr/sbin/init"
> tmpfs:
> - /tmp
> - /run
> capabilities:
> - SYS\_ADMIN
> networks:
> - name: example.com
> provisioner:
> name: ansible
> lint:
> name: ansible-lint
> verifier:
> name: testinfra
> lint:
> name: flake8
> \`\`\`
> \`\`\`YAML
> root@: ~/new-role# molecule list
> \--\> Validating schema /root/new-role/molecule/default/molecule.yml.
> mValidation completed successfully.
> Instance Name Driver Name Provisioner Name Scenario Name Created Converged
> \--------------- ------------- ------------------ --------------- --------- -----------
> nocon01p2 docker ansible default true false
> nocon02p2 docker ansible default true false
> nocon03p2 docker ansible default true false
> root@: ~/new-role# molecule login --host nocon01p2
> \--\> Validating schema /root/new-role/molecule/default/molecule.yml.
> Validation completed successfully.
> \[root@nocon01p2 /\]# exit
> exit
> root@: ~/new-role# molecule login --host nocon02p2
> \--\> Validating schema /root/new-role/molecule/default/molecule.yml.
> Validation completed successfully.
> \[root@nocon01p2 /\]# ssh nocon02p2
> The authenticity of host 'nocon02p2 (172.22.0.3)' can't be established.
> ECDSA key fingerprint is SHA256:jMK4l4RxOBM7d+DbF09stltWQLYrhJ9zjIsZ/fEYg9U.
> ECDSA key fingerprint is MD5:74:ca:44:e2:b8:cd:f4:4b:dc:07:1f:19:23:d4:5f:c7.
> Are you sure you want to continue connecting (yes/no)? yes
> Warning: Permanently added 'nocon02p2,172.22.0.3' (ECDSA) to the list of known hosts.
> root@nocon02p2's password:
> System is booting up. See pam\_nologin(8)
> \[root@nocon01p2 ~\]# ^C
> \`\`\`
> \`\`\`
> ansible --version 
> ansible 2.7.10
> config file = /etc/ansible/ansible.cfg
> configured module search path = \[u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'\]
> ansible python module location = /usr/lib/python2.7/site-packages/ansible
> executable location = /usr/bin/ansible
> python version = 2.7.5 (default, Apr 9 2019, 14:30:50) \[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)\]
> molecule --version
> molecule, version 2.20.1
> \`\`\`
> 
> Molecule installation method :
> \- pip
> 
> Ansible installation method:
> \- pip
> \- OS package
> 
> 
> \# Desired Behavior
> molecule login --host nocon02p2
> should be able to login nocon02p2
> 
> 
> \# Actual Behaviour
> it should be able to login to multiple instance of docker using command line.

# Molecule and Ansible details

```auto
dependency:
  name: galaxy
driver:
  name: docker
lint:
  name: yamllint
platforms:
  - name: nocon01p2
    hostname: nocon01p2.example.com
    image: centos/systemd:1.0
    pre_build_image: True
    privileged: True
    volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    command: "/usr/sbin/init"
    tmpfs:
      - /tmp
      - /run
    capabilities:
      - SYS_ADMIN
    networks:
      - name: example.com
  - name: nocon02p2
    hostname: nocon01p2.example.com
    image: centos/systemd:1.0
    pre_build_image: True
    privileged: True
    volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    command: "/usr/sbin/init"
    tmpfs:
      - /tmp
      - /run
    capabilities:
      - SYS_ADMIN
    networks:
      - name: example.com
  - name: nocon03p2
    hostname: nocon01p2.example.com
    image: centos/systemd:1.0
    pre_build_image: True
    privileged: True
    volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    command: "/usr/sbin/init"
    tmpfs:
      - /tmp
      - /run
    capabilities:
      - SYS_ADMIN
    networks:
      - name: example.com
provisioner:
  name: ansible
  lint:
    name: ansible-lint
verifier:
  name: testinfra
  lint:
    name: flake8

```

```auto
root@: ~/new-role# molecule list
--> Validating schema /root/new-role/molecule/default/molecule.yml.
mValidation completed successfully.
Instance Name Driver Name Provisioner Name Scenario Name Created Converged
--------------- ------------- ------------------ --------------- --------- -----------
nocon01p2 docker ansible default true false
nocon02p2 docker ansible default true false
nocon03p2 docker ansible default true false
root@: ~/new-role# molecule login --host nocon01p2
--> Validating schema /root/new-role/molecule/default/molecule.yml.
Validation completed successfully.
[root@nocon01p2 /]# exit
exit
root@: ~/new-role# molecule login --host nocon02p2
--> Validating schema /root/new-role/molecule/default/molecule.yml.
Validation completed successfully.
[root@nocon01p2 /]# ssh nocon02p2
The authenticity of host 'nocon02p2 (172.22.0.3)' can't be established.
ECDSA key fingerprint is SHA256:jMK4l4RxOBM7d+DbF09stltWQLYrhJ9zjIsZ/fEYg9U.
ECDSA key fingerprint is MD5:74:ca:44:e2:b8:cd:f4:4b:dc:07:1f:19:23:d4:5f:c7.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'nocon02p2,172.22.0.3' (ECDSA) to the list of known hosts.
root@nocon02p2's password:
System is booting up. See pam_nologin(8)
[root@nocon01p2 ~]# ^C

```

```auto
ansible --version 
ansible 2.7.10
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Apr 9 2019, 14:30:50) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
molecule --version
molecule, version 2.20.1

```

---

<div class="post-metadata">

**Author:** ![Kunalsing\_Thakur](https://avatars.discourse-cdn.com/v4/letter/k/3d9bf3/32.png) [@Kunalsing\_Thakur](https://forum.ansible.com/u/Kunalsing_Thakur)\
**Post date:** [May 16, 2019, 1:28pm UTC](https://forum.ansible.com/t/molecule-docker-login-for-multiple-instance/30347/2 "2019-05-16T13:28:14Z")

</div>

ignore this thread.

Hey guies ignore i just paste typo in all hostname all working fine.
