ansible-collection-checkmk.general icon indicating copy to clipboard operation
ansible-collection-checkmk.general copied to clipboard

Fix folder lookup plugin title

Open lgetwan opened this issue 1 year ago • 1 comments

Pull request type

Please check the type of change your PR introduces:

  • [x] Bugfix
  • [ ] Feature
  • [ ] Code style update (formatting, renaming)
  • [ ] Refactoring (no functional changes, no API changes)
  • [ ] Build related changes
  • [ ] Documentation content changes
  • [ ] Other (please describe):

What is the current behavior?

Issue Number: #571 The folder lookup plugin didn't return the folder title, but only the extensions.

What is the new behavior?

  • Return the complete folder information, not only the extensions.

Other information

People using this lookup plugin have to adjust the usage of the variables in the reply.

Before:

- name: "Get attributes of folder."
  ansible.builtin.debug:
    msg: "Criticality of /tests is {{ folder.attributes.tag_criticality }}"
  vars:
    folder: "{{ lookup('checkmk.general.folder',
                    '/tests',
                    server_url=server_url,
                    site=site,
                    validate_certs=False,
                    automation_user=automation_user,
                    automation_secret=automation_secret)
              }}"

After:

- name: "Get attributes of folder."
  ansible.builtin.debug:
    msg: "Criticality of /tests is {{ folder.extensions.attributes.tag_criticality }}"
  vars:
    folder: "{{ lookup('checkmk.general.folder',
                    checkmk_folder.path,
                    '/tests',
                    site=site,
                    validate_certs=False,
                    automation_user=automation_user,
                    automation_secret=automation_secret)
              }}"

lgetwan avatar Apr 10 '24 13:04 lgetwan

@lgetwan so from what I read, this is a breaking change, as users using the module have to adapt their configuration, right? So if they do not act, things break. If that is correct, I would line this up for 5.0.0 and depending on how urgent it is, push to get that release out sooner. But if it is not that critical, I would focus on 4.4.0 for now and release 5.0.0 when we finalized Checkmk 2.3.0 support.

robin-checkmk avatar Apr 15 '24 20:04 robin-checkmk

@lgetwan I think the examples of the module are out of sync with these changes. I looked at the changelog fragment and wanted to update it to be breaking_changes and then realized, that I do not know where to point them to for the necessary changes. Can you double-check and potentially create a pull request based on devel to fix the docs/examples? Thanks!

robin-checkmk avatar May 24 '24 18:05 robin-checkmk

Good point. See #607.

lgetwan avatar May 29 '24 12:05 lgetwan