I also tried that one but it also fails: 
 
- name: test with json_query 1/2
  vars:
        - domain_definition:
                - name: server11
                  cluster: cluster1
                  port: '8080'
                - name: server12
                  cluster: cluster2
                  port: '8090'
                - name: server21
                  cluster: cluster3
                  port: '9080'
                - name: server22
                  cluster: cluster4
                  port: '9090'
  debug:
        var: "{{ domain_definition|
                 json_query('[?name==`server21`].port') }}"
  ignore_errors: yes

leads to: 
  
ok: [localhost] => {
    "<class 'list'>": "VARIABLE IS NOT DEFINED!: "
}

What version of ansible are you using?
I have:
- ansible 2.9.6 (from pypi)
- python3 version = 3.7.7 (default, Mar 12 2020, 02:00:38) [GCC 9.2.1 
20200306]

-- 
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/cca5c8b6-3634-40e7-b111-af7f08addf08%40googlegroups.com.

Reply via email to