Open james-masson opened 1 year ago
I can confirm I also have this issue.
even with roles named 'docker' in other namespaces (for me it was citymesh.docker
changing it to citymesh.docker2
fixed it)
Molecule Version
molecule --version
molecule 4.0.4 using python 3.10
ansible:2.14.3
delegated:4.0.4 from molecule
digitalocean:0.1.dev44+gd71a4f2 from molecule_digitalocean
vagrant:2.0.0 from molecule_vagrant
Ansible Version
ansible --version
ansible [core 2.14.3]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/gianni/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/gianni/git/Ansible/prometheus/.venv/lib/python3.10/site-packages/ansible
ansible collection location = /home/gianni/.ansible/collections:/usr/share/ansible/collections
executable location = /home/gianni/git/Ansible/prometheus/.venv/bin/ansible
python version = 3.10.9 (main, Dec 19 2022, 17:35:49) [GCC 12.2.0] (/home/gianni/git/Ansible/prometheus/.venv/bin/python3)
jinja version = 3.1.2
libyaml = True
molecule/default/molecule.yml
---
dependency:
name: galaxy
driver:
name: vagrant
platforms:
- name: debian-11
box: bento/debian-11
provisioner:
name: ansible
verifier:
name: testinfra
directory: ../resources/tests
lint: |
set -e
yamllint .
ansible-lint --exclude .venv .
molecule/default/converge.yml
---
- name: Converge
hosts: all
roles:
- citymesh.prometheus
meta/main.yml
---
galaxy_info:
author: Gianni Stubbe
description: An Ansible role that installs and configures Prometheus
company: Citymesh
license: unlicensed
min_ansible_version: '2.11'
namespace: citymesh
platforms:
- name: Debian
versions:
- bullseye
galaxy_tags: []
dependencies:
- role: citymesh.docker2
requirements.yml
---
- name: citymesh.docker2
src: ssh://git@gitlab.citymesh.com:1830/ansible/roles/docker.git
scm: git
version: master
with citymesh.docker2
molecule converge
INFO default scenario test matrix: dependency, create, prepare, converge
INFO Performing prerun with role_name_check=0...
INFO Running ansible-galaxy role install -vr requirements.yml --roles-path /home/gianni/.cache/ansible-compat/1809f7/roles
INFO Set ANSIBLE_LIBRARY=/home/gianni/.cache/ansible-compat/1809f7/modules:/home/gianni/.ansible/plugins/modules:/usr/share/ansible/plugins/modules
INFO Set ANSIBLE_COLLECTIONS_PATH=/home/gianni/.cache/ansible-compat/1809f7/collections:/home/gianni/.ansible/collections:/usr/share/ansible/collections
INFO Set ANSIBLE_ROLES_PATH=/home/gianni/.cache/ansible-compat/1809f7/roles:/home/gianni/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles
INFO Using /home/gianni/.cache/ansible-compat/1809f7/roles/citymesh.prometheus symlink to current repository in order to enable Ansible to find the role using its expected full name.
INFO Running default > dependency
WARNING Skipping, missing the requirements file.
WARNING Skipping, missing the requirements file.
INFO Running default > create
PLAY [Create] ******************************************************************
TASK [Create molecule instance(s)] *********************************************
changed: [localhost]
TASK [Populate instance config dict] *******************************************
ok: [localhost] => (item={'Host': 'debian-11', 'HostName': '192.168.121.97', 'User': 'vagrant', 'Port': '22', 'UserKnownHostsFile': '/dev/null', 'StrictHostKeyChecking': 'no', 'PasswordAuthentication': 'no', 'IdentityFile': '/home/gianni/.cache/molecule/prometheus/default/.vagrant/machines/debian-11/libvirt/private_key', 'IdentitiesOnly': 'yes', 'LogLevel': 'FATAL'})
TASK [Convert instance config dict to a list] **********************************
ok: [localhost]
TASK [Dump instance config] ****************************************************
changed: [localhost]
PLAY RECAP *********************************************************************
localhost : ok=4 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
INFO Running default > prepare
PLAY [Prepare] *****************************************************************
TASK [Bootstrap python for Ansible] ********************************************
ok: [debian-11]
PLAY RECAP *********************************************************************
debian-11 : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
INFO Running default > converge
PLAY [Converge] ****************************************************************
TASK [Gathering Facts] *********************************************************
ok: [debian-11]
TASK [citymesh.docker2 : BASE - Install dependency packages] *******************
changed: [debian-11]
TASK [citymesh.docker2 : BASE - Add GPG Key] ***********************************
changed: [debian-11]
TASK [citymesh.docker2 : BASE - Add repository] ********************************
changed: [debian-11]
.........CONTINUED
TASK [citymesh.prometheus : BASE - Create config directory] ********************
ok: [debian-11]
TASK [citymesh.prometheus : BASE - Create prometheus volume] *******************
ok: [debian-11]
TASK [citymesh.prometheus : BASE - Add new network for named containers] *******
ok: [debian-11]
TASK [citymesh.prometheus : BASE - Create target directories for templates and files] ***
ok: [debian-11] => (item=file_sd)
skipping: [debian-11] => (item=file_sd/target.json)
skipping: [debian-11] => (item=prometheus.yml.j2)
....... CONTINUED
with citymesh.docker
molecule converge
INFO default scenario test matrix: dependency, create, prepare, converge
INFO Performing prerun with role_name_check=0...
INFO Running ansible-galaxy role install -vr requirements.yml --roles-path /home/gianni/.cache/ansible-compat/1809f7/roles
INFO Set ANSIBLE_LIBRARY=/home/gianni/.cache/ansible-compat/1809f7/modules:/home/gianni/.ansible/plugins/modules:/usr/share/ansible/plugins/modules
INFO Set ANSIBLE_COLLECTIONS_PATH=/home/gianni/.cache/ansible-compat/1809f7/collections:/home/gianni/.ansible/collections:/usr/share/ansible/collections
INFO Set ANSIBLE_ROLES_PATH=/home/gianni/.cache/ansible-compat/1809f7/roles:/home/gianni/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles
INFO Using /home/gianni/.cache/ansible-compat/1809f7/roles/citymesh.prometheus symlink to current repository in order to enable Ansible to find the role using its expected full name.
INFO Running default > dependency
WARNING Skipping, missing the requirements file.
WARNING Skipping, missing the requirements file.
INFO Running default > create
PLAY [Create] ******************************************************************
TASK [Create molecule instance(s)] *********************************************
changed: [localhost]
TASK [Populate instance config dict] *******************************************
ok: [localhost] => (item={'Host': 'debian-11', 'HostName': '192.168.121.139', 'User': 'vagrant', 'Port': '22', 'UserKnownHostsFile': '/dev/null', 'StrictHostKeyChecking': 'no', 'PasswordAuthentication': 'no', 'IdentityFile': '/home/gianni/.cache/molecule/prometheus/default/.vagrant/machines/debian-11/libvirt/private_key', 'IdentitiesOnly': 'yes', 'LogLevel': 'FATAL'})
TASK [Convert instance config dict to a list] **********************************
ok: [localhost]
TASK [Dump instance config] ****************************************************
changed: [localhost]
PLAY RECAP *********************************************************************
localhost : ok=4 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
INFO Running default > prepare
PLAY [Prepare] *****************************************************************
TASK [Bootstrap python for Ansible] ********************************************
ok: [debian-11]
PLAY RECAP *********************************************************************
debian-11 : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
INFO Running default > converge
PLAY [Converge] ****************************************************************
TASK [Gathering Facts] *********************************************************
ok: [debian-11]
TASK [citymesh.prometheus : BASE - Create config directory] ********************
changed: [debian-11]
TASK [citymesh.prometheus : BASE - Create prometheus volume] *******************
fatal: [debian-11]: FAILED! => {"changed": false, "msg": "Error connecting: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))"}
PLAY RECAP *********************************************************************
debian-11 : ok=2 changed=1 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
WARNING Retrying execution failure 2 of: ansible-playbook --inventory /home/gianni/.cache/molecule/prometheus/default/inventory --skip-tags molecule-notest,notest /home/gianni/git/Ansible/prometheus/molecule/default/converge.yml
CRITICAL Ansible return code was 2, command was: ['ansible-playbook', '--inventory', '/home/gianni/.cache/molecule/prometheus/default/inventory', '--skip-tags', 'molecule-notest,notest', '/home/gianni/git/Ansible/prometheus/molecule/default/converge.yml']
Issue Type
Molecule and Ansible details
Molecule installation method (one of):
Ansible installation method (one of):
Detail any linters or test runners used:
Desired Behavior
Molecule should successfully run a role called "docker"
Actual Behaviour
Molecule ignores a role called "docker", but successfully runs against the same role renamed "docker2", or any other name.
role layout
contents of the task
molecule
converge.yml
molecule run result via
PY_COLORS=0 molecule --debug converge -s docker > test.txt 2>&1