|- name: Ansible tests playbook|
|- name: Check if mariadb-libs-5.5.44-2.el7.centos.x86_64 package is installed|
|- name: Removing old mariadb-libs package|
|when: ansible_os_family == 'RedHat' and|
|pkg.results.yumstate == 'installed'|
hi, found this nice snippet, but for me it does not work under all circumstances.
I'm using the oracle-mysql-community repositories and it keeps listing the first found, not the last one.
Even trying pkg.results[-1].yumstate == 'installed' does not work.
Hi, you can use this code:
Works for me
I am using the code suggested by CrusaderX and I am getting the below error:
I am running on Redhat 7.1
@beebird solution is cleanest
the package_facts module maybe better for this.