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?