In jason query how can i add regular expression ? eg if have vm1, vm2,vm3 
below query can be adjusted ? eg       query: "[?guest_name == 'vm*' ]" , 
seems does not work in below case 


https://jmespath.org/specification.html#filterexpressions  i tried few 
things but no luck 

Thanks


---
> - hosts: localhost
>   vars_files:
>     - vcsim_vars.yml
>   tasks:
>   - name: Gather all VMs information
>     vmware_vm_info:
>       hostname: '{{ vcenter_hostname }}'
>       username: '{{ vcenter_username }}'
>       password: '{{ vcenter_password }}'
>       validate_certs: no
>     register: vm_facts
>     delegate_to: localhost
>   - debug:
>       msg:  "{{ item.ip_address }}"
>     with_items:
>     - "{{ vm_facts.virtual_machines | json_query(query) }}"
>     vars:
>       query: "[?guest_name == 'vm1' ]"


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4e22d894-160a-4a1f-8a1f-0cb8fb5aa6ca%40googlegroups.com.

Reply via email to