Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for dependencies #8

Closed
gurpalw opened this issue Aug 30, 2024 · 1 comment
Closed

support for dependencies #8

gurpalw opened this issue Aug 30, 2024 · 1 comment

Comments

@gurpalw
Copy link
Contributor

gurpalw commented Aug 30, 2024

When testing a role that depends on another role, rolecule fails with the below error:

 rolecule test -n                                      ✔ │ ▼  x   15:44:34  
   • creating container rolecule-redis_exporter-ubuntu-22.04 with docker
   • converging container rolecule-redis_exporter-ubuntu-22.04 with ansible
ERROR! the role 'docker' was not found in ansible.legacy:/src/tests/roles:/src:/:/src/tests

The error appears to be in '/src/meta/main.yml': line 3, column 5, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

dependencies:
  - role: docker
    ^ here
   ⨯ command failed: exit status 1
   • verifying container rolecule-redis_exporter-ubuntu-22.04 with goss (goss.yaml)
Error: found 0 tests, source: tests/goss.yaml
   ⨯ command failed: exit status 78

here is my tests/playbook.yml:

---
- name: test
  hosts: localhost
  roles:
    - role: .

rolecule.yml:

---
engine:
  name: docker

provisioner:
  name: ansible

verifier:
  name: goss

instances:
  - name: ubuntu-22.04
    image: ubuntu-systemd:22.04

and the meta/main.yml:

---
dependencies:
  - role: docker
    vars:
      docker:
        network: "{{ redis_exporter.network }}"

the docker role is on this path ansible/roles/docker. along with the redis_exporter role: ansible/roles/redis_exporter.

Adding support for this would be super useful.

Thank you.

@z0mbix
Copy link
Owner

z0mbix commented Sep 6, 2024

Great idea @gurpalw This has now been implemented in #11 and released as version v0.2.0.

See the release here: https://github.com/z0mbix/rolecule/releases/tag/v0.2.0

@z0mbix z0mbix closed this as completed Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants