fix: No longer delegate to localhost 🐛
Some checks failed
CI / lint (push) Failing after 1m53s
CI / Molecule Test (almalinux8) (push) Has been skipped
CI / Molecule Test (almalinux9) (push) Has been skipped
CI / release (push) Has been skipped
CI / notify (push) Has been skipped

This caused some issues when used in a delegated fashion.
This commit is contained in:
2025-03-03 22:41:45 +13:00
parent c29898b542
commit 01adff887f
7 changed files with 389 additions and 11 deletions

View File

@@ -1,13 +1,6 @@
---
- name: Retrieve checkmk version
uri:
method: GET
headers:
Authorization: Bearer {{ cmk_username }} {{ cmk_secret }}
Accept: application/json
url: '{{ cmk_omd_protocol }}://{{ cmk_omd_host }}/{{ cmk_omd_site }}/check_mk/api/1.0/version'
return_content: true
register: cmk_output
- include_tasks: host-management/{{ ansible_os_family}}/check.yml
- name: Set facts # noqa jinja[spacing]
set_fact:
@@ -24,12 +17,14 @@
debug:
var: '{{ item }}'
with_items: [cmk_major, cmk_minor, cmk_patch, cmk_edition]
- include_tasks: host-management/legacy.yml
- include_tasks: host-management/{{ ansible_os_family}}/legacy.yml
when: >
cmk_add_host and
(cmk_major | int <= 2 and
cmk_minor | int < 2 or cmk_force_install)
- include_tasks: host-management/modern.yml
- include_tasks: host-management/{{ ansible_os_family}}/modern.yml
when: >-
cmk_add_host and
(cmk_major | int >= 2 and