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

[Feature request] Add role dependencies as separate nodes #227

Open
Geertsky opened this issue Dec 20, 2024 · 1 comment
Open

[Feature request] Add role dependencies as separate nodes #227

Geertsky opened this issue Dec 20, 2024 · 1 comment
Labels
feature-request An issue related to a new feature

Comments

@Geertsky
Copy link

Describe the bug
It seems like this feature has been requested before at #39, but I'll just describe my use case.
I have a playbook with a role test. The role test has a dependency defined in meta/main.yml for the role test2. Both roles contain one task.
When I issue ansible-playbook --list-tasks playbook-test.yml it shows the two tasks below the play. So there is no way to see that these tasks are part of a role or a dependant role.
It would however be great if this role dependency would be visible in the generated graph of ansible-playbook-grapher! And as said before it seems this feature was implemented in 12cee0f

To Reproduce
playbook-test.yml

---

- name: test
  hosts: localhost
  gather_facts: false
  roles:
    - role: test

test/meta/main.yml

dependencies:
  - role: test2

test/tasks/main.yml

---

- name: Task from role test
  ansible.builtin.debug:
    msg: Msg from a task from role test

test2/tasks/main.yml

---

- name: Task from role test2
  ansible.builtin.debug:
    msg: Msg from a task from role test2

Expected behavior
It would be nice when the role dependency was visible in the graph.

Screenshots
Something like:
playbook-test with_dependency
instead of:
playbook-test

Versions:
Outputs of :

  • ansible --version
ansible [core 2.17.6]
  config file = ansible.cfg
  configured module search path = ['/home/geertsky/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/geertsky/miniforge3/envs/ansible-2.17.6-playbook-grapher/lib/python3.13/site-packages/ansible
  ansible collection location = /home/geertsky/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/geertsky/miniforge3/envs/ansible-2.17.6-playbook-grapher/bin/ansible
  python version = 3.13.1 | packaged by conda-forge | (main, Dec  5 2024, 21:23:54) [GCC 13.3.0] (/home/geertsky/miniforge3/envs/ansible-2.17.6-playbook-grapher/bin/python3.13)
  jinja version = 3.1.4
  libyaml = True
**Additional context**
Add any other context about the problem here.
@haidaraM haidaraM added the feature-request An issue related to a new feature label Dec 20, 2024
@haidaraM
Copy link
Owner

The grapher already does support the role dependencies since the tasks from both roles are added to the graph. What you are describing is kind of a feature request or a modification of the current behavior. At the end of the day, all tasks are in the graph.

Not sure how easy it might be to track the role dependencies separately as roles themself in the graph but will see...

@haidaraM haidaraM changed the title [Bug report] Add support for role dependencies #39 seems lost [Feature request] Add role dependencies as separate nodes Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request An issue related to a new feature
Projects
None yet
Development

No branches or pull requests

2 participants