ANSIBLE - lookup plugin (checkmk.general.folders) not found

Hi,

I’ve successfully installed Ansible CheckMK module on my AWX with requirements.yml files.

Traces when i update the project :

Downloading https://old-galaxy.ansible.com/download/checkmk-general-3.2.0.tar.gz to /var/lib/awx/projects/.__awx_cache/_8__dba/stage/tmp/ansible-local-87nh1x8v1x/tmp3v1i73ai/checkmk-general-3.2.0-uu56ihi1
Installing 'checkmk.general:3.2.0' to '/var/lib/awx/projects/.__awx_cache/_8__dba/stage/requirements_collections/ansible_collections/checkmk/general'
checkmk.general:3.2.0 was installed successfully

I want to list all the subfolders of my CheckMK site.
I use this example : ansible-collection-checkmk.general/docs/folders_lookup.rst at main · Checkmk/ansible-collection-checkmk.general · GitHub

Below my Ansible code to test :

- name: "Use variables outside the module call."
  ansible.builtin.debug:
    msg: "Folder tree: {{ item.id }}"
  vars:
    ansible_lookup_checkmk_server_url: "{{ check_mk_url_api}}"
    ansible_lookup_checkmk_site: "serveurs"
    ansible_lookup_checkmk_automation_user: "{{ user }}"
    ansible_lookup_checkmk_automation_secret: "{{ password }}"
    ansible_lookup_checkmk_validate_certs: false
  loop: "{{
    lookup('checkmk.general.folders',
        '~',
        show_hosts=False,
        recursive=True,
        ) }}"
  loop_control:
    label: "{{ item.id }}"

But when i execute this play, i’v got the error below :

{
  "msg": "lookup plugin (checkmk.general.folders) not found",
  "_ansible_no_log": false
}

Do you know why the play not find the module ?
I always use FQCN of module name.

Thanks for your help,

Matt

I think the problem is easy to fix.
You installed version 3.2.0 (nearly two years old) of the collection. The latest version is 5.8.0.

3 Likes

Hi @andreas-doehler

Indeed the release was a little bit too old :).

In my requirement file, i tried to force the release

- name: checkmk.general
  version: 5.8.0

When i tried to update my project, i’ve got this error message.

ERROR! Failed to resolve the requested dependencies map. Could not satisfy the following requirements:
* checkmk.general:5.8.0 (direct request)
Hint: Pre-releases hosted on Galaxy or Automation Hub are not installed by default unless a specific version is requested. To enable pre-releases globally, use --pre.

My Ansible version in my AWX is [2.16.6].

How can i install the last release of this module ?

Thanks fo ryour help,

Matt

Hi,

I found my problem.

When i installed the first AWX platform i’v a problem to download module on galaxy platform.

I use this fix Skipping Galaxy server https://galaxy.ansible.com/api/ · Issue #14496 · ansible/awx · GitHub to configure old-galaxy.

But on old;galaxy checkmk module is still on 3.2.0 release

I disabled old-galaxy and enable last galaxy platform and now i’v got the last release of checkmk module.

Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/checkmk-general-5.8.0.tar.gz to /var/lib/awx/projects/.__awx_cache/_8__dba/stage/tmp/ansible-local-8714gswb5s/tmpmu2u4_r4/checkmk-general-5.8.0-s45dsq60
Installing 'checkmk.general:5.8.0' to '/var/lib/awx/projects/.__awx_cache/_8__dba/stage/requirements_collections/ansible_collections/checkmk/general'
checkmk.general:5.8.0 was installed successfully

Thanks for your help,

Matt

1 Like