i bumped into an issue after migrated from python2 to python3. Seems that migration somehow changed the way how json query is being processed. Maybe anyone has a hint how to fix this
vars:
vmk_out:
host_vmk_info:
hostname:
[
{
ipv4_address: "10.10.10.101",
ipv4_subnet_mask: "255.255.255.0",
stack: "defaultTcpipStack"
},
{
ipv4_address: "10.10.20.101",
ipv4_subnet_mask: "255.255.255.0",
stack: "vmotion"
}
]
tasks:
- name: Extract list of IPs
set_fact:
output: "{{ vmk_out.host_vmk_info.values() |json_query('[].ipv4_address') }}"
Above ran under Python2 with Ansible 2.9.1 returns list of IP addresses but running the same under Python3 returns the empty list