# Trying To Get Certain Package Information In A List Format For All Host

**URL:** <https://forum.ansible.com/t/trying-to-get-certain-package-information-in-a-list-format-for-all-host/35281>\
**Category:** Ansible Project\
**Created:** [June 4, 2021, 2:17am UTC](https://forum.ansible.com/t/trying-to-get-certain-package-information-in-a-list-format-for-all-host/35281 "2021-06-04T02:17:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcus\_Hayhurst](https://avatars.discourse-cdn.com/v4/letter/m/a88e4f/32.png) [@Marcus\_Hayhurst](https://forum.ansible.com/u/Marcus_Hayhurst)\
**Post date:** [June 4, 2021, 2:17am UTC](https://forum.ansible.com/t/trying-to-get-certain-package-information-in-a-list-format-for-all-host/35281/1 "2021-06-04T02:17:06Z")

</div>

Hello everyone,

I was trying to loop through all my hosts and if a certain package (xauth in this case) was present it would create a list and email that list with this information:

If package was found:  
**HOSTNAME - PACKAGE\_NAME:VERSION**

If package was not found:  
**PACKAGE\_NAME Not Found on HOSTNAME**

I thought this would work but it does not.

- name: GATHER INSTALLED PACKAGES INFORMATION  
package\_facts:  
manager: auto  
strategy: all  
ignore\_errors: True
