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 a key to hide plays(tasks) without any role #176

Closed
fireman777 opened this issue Mar 14, 2024 · 11 comments
Closed

[Feature request] Add a key to hide plays(tasks) without any role #176

fireman777 opened this issue Mar 14, 2024 · 11 comments
Labels
feature-request An issue related to a new feature

Comments

@fireman777
Copy link

fireman777 commented Mar 14, 2024

Is your feature request related to a problem? Please describe.
It would be great if there would be an opportunity to hide plays(tasks) without any role.

Describe the solution you'd like
Please consider adding a key (for example --hide-tasks-without-roles) to ansible-playbook-grapher to hide plays(tasks) without any role.

image

@haidaraM
Copy link
Owner

Hi,

Trying to understand the use case: basically, you just want to display the roles (and their tasks) without any standalone tasks?

@fireman777 fireman777 changed the title [Feature request] Add a key to hide tasks without any role [Feature request] Add a key to hide plays(tasks) without any role Mar 15, 2024
@fireman777
Copy link
Author

fireman777 commented Mar 15, 2024

Hi @haidaraM,
Sorry for confusing you from my side. I mean plays. Here is a picture where I showed what I mean:
IMG_150324_01
It can be useful when you have a lot of plays and some roles won't be executed due to some conditions (tags). Depending on the tags there can be different play shown in the diagram.
P.S.: I've updated the feature request name and description for better understanding.

@haidaraM
Copy link
Owner

No problem :-)

I got the idea. What do you think about just excluding plays that end up with no tasks at all (not only roles)?

@haidaraM haidaraM added the feature-request An issue related to a new feature label Mar 15, 2024
@fireman777
Copy link
Author

Hi @haidaraM,
I think it's a good idea, but I would separate these two options, for example:
--hide-plays-without-roles: hide (don't show) plays without any role;
--hide-plays-without-tasks: hide (don't show) plays without any task.
I can explain why it can be useful: example, in playbook have lot of plays and a lot of combination of tags. Depending on tag that we can select, we will have quite different pictures (graphs). It's important at this moment to have the ability to exclude some plays without roles/tasks, because some projects may have hundreds of plays.
So, my mind is that it's better to have two options: --hide-plays-without-roles and --hide-plays-without-tasks.
We would be very thankful if you could implement such functionality.

@haidaraM
Copy link
Owner

Interesting. Makes sense!

Should be easily doable!

@haidaraM
Copy link
Owner

--hide-plays-without-roles: hide (don't show) plays without any role;

This also needs to consider the usages of include_role inside the play. That means I need to consider all the tasks inside the play to decide if I need to display the play or not (not only the roles set on the play level).

@fireman777
Copy link
Author

Thank you for your willingness to help. Your project is very interesting and in my opinion, has a great future.

@haidaraM
Copy link
Owner

Thanks for the feedback, I appreciate it :-)

@haidaraM
Copy link
Owner

Can you give a try to pip install "ansible-playbook-grapher @ git+https://github.com/haidaraM/ansible-playbook-grapher@hide-plays" and let me know. I added two new flags.

See #177

@fireman777
Copy link
Author

Hi @haidaraM, I've tested already and it works as expected.
I want to thank you and wish you and your project a powerfull future.
Thanks a lot.

@haidaraM
Copy link
Owner

Closing this. Will be released in the next version (following days/weeks).

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