Looking for an ansible module which supports yum-utils package

Hi ,

I am looking for an ansible module which supports yum-utils package commands.
It consists of a command **"package-cleanup**" which is pretty useful in cleaning the old kernels.

package-cleanup --oldkernels --count=2   <= this  command will clean up all old kernels and keep just two(The current one and the previous one)

But on search in the Module index of ansible, or under package management,there is no module for this command “package-cleanup”.

Do anyone uses the ansible modules of commands from yum-utils? Kindly share the details …

Take a look at the autoremove parameter in the YUM module that may help https://docs.ansible.com/ansible/latest/modules/yum_module.html or you may have to use the command module