alvistack / ansible-role-podman

Ansible Role for Podman Installation
Apache License 2.0
62 stars 6 forks source link

role 'alvistack.podman' was not found - localhost play #13

Closed lvnilesh closed 2 years ago

lvnilesh commented 2 years ago
molecule converge -s default

fails with the following


TASK [include role] ************************************************************
ERROR! the role 'alvistack.podman' was not found in /root/.ansible/roles/podman/molecule/default/roles:/root/.cache/ansible-compat/2f259b/roles:/root/.cache/molecule/podman/default/roles:/root/.ansible/roles:/root/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/root/.ansible/roles/podman/molecule/default

The error appears to be in '/root/.ansible/roles/podman/molecule/default/converge.yml': line 44, column 15, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

      ansible.builtin.include_role:
        name: alvistack.podman
              ^ here

PLAY RECAP *********************************************************************
localhost                  : ok=28   changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

WARNING  Retrying execution failure 2 of: ansible-playbook --inventory /root/.cache/molecule/podman/default/inventory --skip-tags molecule-notest,notest /root/.ansible/roles/podman/molecule/default/converge.yml
CRITICAL Ansible return code was 2, command was: ['ansible-playbook', '--inventory', '/root/.cache/molecule/podman/default/inventory', '--skip-tags', 'molecule-notest,notest', '/root/.ansible/roles/podman/molecule/default/converge.yml']
hswong3i commented 2 years ago

There is some tricks for setting up this Ansible Role for direct use with Molecule, please check https://github.com/alvistack/ansible-role-podman/blob/master/.gitlab-ci.yml#L70-L79 for some reference, e.g.

mkdir -p $HOME/.ansible/roles
cd $HOME/.ansible/roles
git clone -b develop https://github.com/alvistack/ansible-role-podman.git alvistack.podman
cd alvistack.podman
molecule converge -s default
hswong3i commented 2 years ago

P.S. Please kindly understand by default Ansible Role is NOT designed as working independently, but being used by a wrapper Ansible Playbook (well, here by default means official Ansible logic).

This hack using molecule converge -s default for localhost provision is based on following tricks:

If this all matched correctly as like as my https://github.com/alvistack/ansible-role-podman/blob/master/.gitlab-ci.yml setup, it should be working without any issue ;-)