How to check if any package is installed on remote system ?

Hi,

I am looking for some option in yum module to check if any specific package is installed or not ? Can anyone help me on the same.

Regards,
Pratik.

Hi,

It depend on what you want to achieve, the yum module can check if a package is installed or not then install or remove using the state parameter.
However if you just want to check if a package is installed or not then something like this post:
http://stackoverflow.com/questions/21892603/how-to-make-ansible-execute-a-shell-script-if-a-package-is-not-installed

but for yum the command would probably be: yum list installed

-Nico