when ansible Conditionals

Hello

In below how can i skip the output when is not relevant or how to do this better way ?

Thanks

This information is already gathered and available to you by default, no need for wheel reinventing

Hello

In below how can i skip the output when is not relevant or how to do this better way ?

It is not clear from your tasks or their name what you are trying to achieve.
"check OS version" - what does that mean?
More generally speaking, without knowing what you want to do, it's
also not possible to tell how to do it better.

Also, what does "relevant" mean in this context? That seems a highly
subjective term...

This playbook check OS & then run diff cmd per OS & works fine

But the Debug output is not compact … it is verbose mode kind… if the OS is not say CentOS it gives 4 to 5 lines stating the same … the out is not compact … somehow is it possible to ignore that … so mat be debug is not the way to go … hence asking to folks for suggestions … thanks

This playbook check OS & then run diff cmd per OS & works fine

But the Debug output is not compact .. it is verbose mode kind.. if the OS is not say CentOS it gives 4 to 5 lines
stating the same .. the out is not compact .. somehow is it possible to ignore that .. so mat be debug is not the way to
go .. hence asking to folks for suggestions .. thanks

So which output do you expect?

BTW: you can improve the readability of the output with setting "stdout_callback = yaml" in your ansible.cfg.

Regards
         Racke