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

16 views
Skip to first unread message

Pratik Bandarkar

unread,
Jul 10, 2016, 3:02:02 PM7/10/16
to Ansible Project
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.

Nico

unread,
Jul 10, 2016, 8:09:09 PM7/10/16
to Ansible Project
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 <package-name>

-Nico
Reply all
Reply to author
Forward
0 new messages