How can I check for an installed packaged version on multiple linux hosts?

HOW TO -️ October 18, 2021

i need to check more than 100 servers for the snapd package, but I don't like the output at all. I searched all day for different options without luck. Attached is the output of ansible-playbook. Any hints guys? enter image description here

ERROR Rendering Code Block

For checking the package version I tried with the following playbook but Ansible doesn't like the syntax:

ERROR Rendering Code Block

Thanks, Juls


I simple way would be to do ansible -i -m shell -a "rpm -qa | grep "; that would display a list consisting of server name and package version. @13dimitar you should put that ad-hoc play into an answer :-)