AAP error: "template error while templating string: No module named 'ansible.module_utils.compat.version'. String: {{ mountfact | community.general.json_query( query ) }}",

221 views
Skip to first unread message

G-train99

unread,
May 14, 2024, 10:45:45 AM5/14/24
to Ansible Project
I'm not using  'ansible.module_utils.compat.version'.  AAP is using that module, i guess.
Underneath playbook works locally, not in AAP. The fact mountfact is a dict. I've also tried to add to_json , from_json, and both, without any changes.
I made a SO post as i'm currently blocked with this. Not sure what to troubleshoot next.
This is part of a role, underneath my test playbook.

 ---
- name: get instana mounts
  hosts: localhost
  tasks:
    - ansible.builtin.setup:
          filter: 'ansible_mounts'
      delegate_to: vmcode1234
      connection: ssh
      register: mountfat

    - debug:
          var: item
       loop: "{{ mountfat | community.general.json_query( query ) }}"
       vars:
         query: "ansible_facts.ansible_mounts[?contains(mount,'instana')].mount"
Reply all
Reply to author
Forward
0 new messages