Issue
I am trying to output a list of installed yum packages before and after running the yum update
command in ansible. However, I note that for the list parameter, there are other options such as installed
, updates
, available
and repos
. May I know what is the difference between these options?
Solution
Is making reference to the options avaialble in the "yum" package managenent. So easier way to know the difference is by referencing to "yum" documentation itself (or man page), as "yum" ansible module only uses its capabilities.
list - As ansible module doc explains, it is the equivalent to "yum list --show-duplicates "
installed - Will list the yum installed packages in the host
updates - Will return a list with the packages to be updated
available - Lists available packages.
repos - Will list the subscribed repos for the host.
You can always see the difference by yourself even using ad-hoc commands and visually exploring the output, like this.
ansible kube_workers -m yum -a 'list=repos'
Hope that helped.
Answered By - Sebastián Greco Answer Checked By - Mary Flores (WPSolving Volunteer)