https://github.com/ansible/molecule/issues/2044
Molecule and Ansible details
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
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