Ansible module "folder", setting attributes

I’d like to set some attributes when creating a folder with Ansible. This works as expected on the first run:

    - name: create single folder
        server_url: "{{ server_url }}"
        site: "{{ site }}"
        automation_user: "{{ automation_user }}"
        automation_secret: "{{ automation_secret }}"
        path: /compute/testme
        name: testme
              - "testme-admin"
            recurse_perms: true
        state: present
      delegate_to: localhost

but throws an error on subsequent runs:

fatal: [testps -> localhost]: FAILED! => {"changed": false, "msg": "Error calling API. HTTP code 400. Details: b'{\"title\": \"Bad Request\", \"status\": 400, \"detail\": \"These fields have problems: name\", \"fields\": {\"name\": [\"Unknown field.\"]}}', "}

Without the attributes part, the task is idempotent. Any idea what’s wrong?

Hey @joernc and thanks for reporting this.
This actually looks like a bug, so I would ask you to open an issue here: Issues · tribe29/ansible-collection-tribe29.checkmk · GitHub

Here you go: module "folder" not idempotent when setting attributes · Issue #289 · tribe29/ansible-collection-tribe29.checkmk · GitHub

Thanks for looking into this!

1 Like