You cannot install a dependency needed for a filter plugin, within the same playbook that requires it as a dependency. Filter plugins are loaded at ansible startup, and the imports are processed and cached by python at this time.
As such, if it is missing at the beginning of the playbook execution, it will remain missing for the remainder of the execution. I should also indicate that the dependency for filters, must be installed on the Ansible controller, and installed using the python used to run Ansible. On Tue, Apr 7, 2020 at 4:42 PM Bob M <[email protected]> wrote: > > 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! > > -- > 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/62d18de2-d6d4-4508-95c0-6723f801bb68%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/62d18de2-d6d4-4508-95c0-6723f801bb68%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Matt Martz @sivel sivel.net -- 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/CAD8N0v8ym_Bs%2B6ZXrcqBO8iRGjjsrtr3ut-yoxy6JdUPBa9Yhg%40mail.gmail.com.
