Ill let a fast sample bit of code do the talking:
---
- name: query test
hosts: "localhost"
gather_facts: no
tasks:
- set_fact:
drives:
- lun: 0
size: "25gb"
- lun: 1
size: "100gb"
- vars:
json_query: "[?lun=='0']"
set_fact:
output: "{{ drives | json_query(json_query) }}"
- debug:
var: output
So in the above example, output = [], because json_query looks for a string
and not an integer. If I were to change the dictionary to use only strings
I'd have no issues.
So ... does anyone know how to use json_query against integers?
--
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/cfdf4b9a-bf0b-43fc-acfd-1ac94c9cfe05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.