There are several packages with a common name: package-somethins1 
package-special

---
- hosts: Special_hosts
  name: "Get version of RPM"
  tasks:
    - name: yum_command 
      yum:
        list=installed
      register: yum_packages

    - debug: var=item
      with_items: "{{yum_packages|json_query(jsonquery)}}"
      vars:
        jsonquery: "results[?name=='package*']"



How to get the version of the installed package with regexp via Ansible?

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/11a3654d-ccd3-4742-b219-5144c7a06f49%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to