Ansible AAP: template error while templating string: No module named ‘ansible.module_utils.compat.version’

This task is part of a role which decommissions VM’s. To test one part of the role separately which is causing an issue, i have put it into a playbook.
The error i get is: "msg": "template error while templating string: No module named 'ansible.module_utils.compat.version'. String: {{ mountfat | community.general.json_query( query ) }}",

Playbook used in AAP:

---
- name: test get instana mounts
  hosts: localhost
  vars:
    - vmname: vmcode1234
  tasks:
    - ansible.builtin.setup:
        filter: 'ansible_mounts'
      delegate_to: "{{ vmname }}"
      connection: ssh
      register: mountfat

    - debug:
        msg: "{{ mountfat | community.general.json_query( query ) }}"
      vars:
        query: "ansible_facts.ansible_mounts[?contains(mount,'instana')].mount"

mountfat:

{
  "ansible_facts": {
    "ansible_mounts": [
      {
        "mount": "/foo",
        "device": "n/a",
        "fstype": "xfs",
        "options": "n/a",
        "size_total": 37558423552,
        "size_available": 34027737088,
        "block_size": 4096,
        "block_total": 9169537,
        "block_available": 8307553,
        "block_used": 861984,
        "inode_total": 18348032,
        "inode_available": 18293524,
        "inode_used": 54508,
        "uuid": "n/a"
      },
      {
        "mount": "/foo",
        "device": "n/a",
        "fstype": "xfs",
        "options": "n/a",
        "size_total": 5358223360,
        "size_available": 5286584320,
        "block_size": 4096,
        "block_total": 1308160,
        "block_available": 1290670,
        "block_used": 17490,
        "inode_total": 2621440,
        "inode_available": 2621418,
        "inode_used": 22,
        "uuid": "n/a"
      },
      {
        "mount": "/foo",
        "device": "n/a",
        "fstype": "xfs",
        "options": "n/a",
        "size_total": 5358223360,
        "size_available": 5276213248,
        "block_size": 4096,
        "block_total": 1308160,
        "block_available": 1288138,
        "block_used": 20022,
        "inode_total": 2621440,
        "inode_available": 2621365,
        "inode_used": 75,
        "uuid": "n/a"
      },
      {
        "mount": "/foo",
        "device": "n/a",
        "fstype": "xfs",
        "options": "n/a",
        "size_total": 1063256064,
        "size_available": 785780736,
        "block_size": 4096,
        "block_total": 259584,
        "block_available": 191841,
        "block_used": 67743,
        "inode_total": 524288,
        "inode_available": 523971,
        "inode_used": 317,
        "uuid": "n/a"
      },
      {
        "mount": "/app/instana",
        "device": "n/a",
        "fstype": "xfs",
        "options": "n/a",
        "size_total": 2136997888,
        "size_available": 2088247296,
        "block_size": 4096,
        "block_total": 521728,
        "block_available": 509826,
        "block_used": 11902,
        "inode_total": 1048576,
        "inode_available": 1048571,
        "inode_used": 5,
        "uuid": "n/a"
      },
      {
        "mount": "/app/instana/metrics",
        "device": "n/a",
        "fstype": "xfs",
        "options": "n/a",
        "size_total": 518684672,
        "size_available": 488591360,
        "block_size": 4096,
        "block_total": 126632,
        "block_available": 119285,
        "block_used": 7347,
        "inode_total": 256000,
        "inode_available": 255997,
        "inode_used": 3,
        "uuid": "n/a"
      }
    ]
  },
  "invocation": {
    "module_args": {
      "filter": "ansible_mounts",
      "gather_subset": [
        "all"
      ],
      "gather_timeout": 10,
      "fact_path": "/etc/ansible/facts.d"
    }
  },
  "_ansible_verbose_override": true,
  "_ansible_no_log": false,
  "changed": false,
  "_ansible_delegated_vars": {
    "ansible_host": "vmcode1234",
    "ansible_port": null,
    "ansible_user": "ansibleuser"
  }
}

The module module_utils is to create plugins, i’m not using this module at all, which makes me believe AAP/podman is maybe using that. Googling on that error did not give me any leads.

What i tried and didn’t work:
1 quoted ‘qry
2 msg to var
3 set_fact used instead of debug
4 add connection: local, comment connection: ssh; comment connection: local

 1:   - debug:
        msg: "{{ mountfat | community.general.json_query( 'query' ) }}"
      vars:
        query: "ansible_facts.ansible_mounts[?contains(mount,'instana')].mount"

 2:   - debug:
        var: "{{ mountfat | community.general.json_query( query ) }}"
      vars:
        query: "ansible_facts.ansible_mounts[?contains(mount,'instana')].mount"

 3:   - set_fact:
        insta_m: "{{ mountfat | community.general.json_query( qry ) }}"
      vars:
        qry: "ansible_facts.ansible_mounts[?contains(mount,'instana')].mount"

      - debug:
          var: "{{ insta_m }}"

 4:   - name: test get instana mounts
        hosts: localhost
        #connection: local
        vars:
          - vmname: vmcode1234
        tasks:
          - ansible.builtin.setup:
              filter: 'ansible_mounts'
            delegate_to: "{{ vmname }}"
            #connection: ssh
            register: mountfat

Before to try this in AAP, i tested it locally ( in my VM) and this did work. I’m puzzled how to troubleshoot this further.

---
- name: get /app/instana mounts
  hosts: test
  connection: local
  vars:
  #vars_files:
  #  - mountfact.yml
  tasks:
    - ansible.builtin.setup:
        filter: 'ansible_mounts'
      delegate_to: "vmcode1234"
      connection: ssh
      register: mountfat

    - set_fact:
        inst_m: "{{ mountfat | community.general.json_query( query )  }}"
      vars:
        query: "ansible_facts.ansible_mounts[?contains(mount,'instana')].mount"

    - debug:
        msg: "{{ inst_m }}" 

output of above and intended required output in AAP:

TASK [debug] ***********************************************************************************************************************************************
ok: [vmcode1235] => {
    "msg": [
        "/app/instana",
        "/app/instana/metrics"
    ]
}

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật