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

16 views
Skip to first unread message

Антон Пацев

unread,
May 22, 2017, 10:19:21 AM5/22/17
to Ansible Project
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?
Reply all
Reply to author
Forward
0 new messages