Right now in my current setup I am using Ansible with CentOs hosts. One of the tasks contains the following line:
command: yum list installed somepackagename
As seen above the task will only work for hosts which support yum , but what if I want to run it on Ubuntu or some other Linux distribution?
After researching a bit online I found out that there is a generic package manager called package. With this I install/uninstall packages without worrying about the underlying hosts but not do something like list them as seen above.
Is there any module or any way I could achieve this in a generic way without creating multiple whens?