I’m running this section of code on a proxmox ansible controller. And I still get an error saying jmespath not found.
fatal: [master]: FAILED! => {“msg”: “You need to install "jmespath" prior to running json_query filter”}
In the same playbook, as a pre-task, I’ve tried to apt install python3-jmespath and python-jmespath, and still get the error.
-
name: 06_create_vm_template | Install jmespath and proxmoxer via pip
pip:
name: -
jmespath
-
proxmoxer
tags: [ install ] -
name: 06_create_vm_template | set vm_ip_addrs from qm guest network-get-interfaces
set_fact:
vm_ip_addrs: “{{ vm_ip_addrs + (template_ip | from_json | json_query(jmesquery) | ipaddr(‘10.9.0.10/16’) | list) }}”
vars:
jmesquery: ‘[*].“ip-addresses”.“ip-address”’
loop: “{{ result.results | map(attribute=‘stdout’) | list }}”
loop_control:
loop_var: “template_ip”
index_var: counter
Any ideas? Thanks!