From 3ef564bab710d4f2779a3ecb8e7f1d9b810ec006 Mon Sep 17 00:00:00 2001 From: mag Date: Mon, 1 Dec 2025 11:50:51 +0100 Subject: [PATCH] Upload files to "vars" --- vars/Debian.yml | 11 +++++++++++ vars/RedHat.yml | 11 +++++++++++ vars/Suse.yml | 11 +++++++++++ vars/Windows.yml | 13 +++++++++++++ vars/main.yml | 35 +++++++++++++++++++++++++++++++++++ 5 files changed, 81 insertions(+) create mode 100644 vars/Debian.yml create mode 100644 vars/RedHat.yml create mode 100644 vars/Suse.yml create mode 100644 vars/Windows.yml create mode 100644 vars/main.yml diff --git a/vars/Debian.yml b/vars/Debian.yml new file mode 100644 index 0000000..8cab955 --- /dev/null +++ b/vars/Debian.yml @@ -0,0 +1,11 @@ +--- +__checkmk_agent_host_tmp_dir: "/tmp" + +__checkmk_agent_agent: + url: + cre: "{{ __checkmk_agent_site_url }}/check_mk/agents/check-mk-agent_{{ checkmk_agent_version }}-1_all.deb" + cee: "{{ __checkmk_agent_site_url }}/check_mk/api/1.0/domain-types/agent/actions/download_by_host/invoke" + file: + cre: "{{ __checkmk_agent_host_tmp_dir }}/check-mk-agent_{{ checkmk_agent_version }}-vanilla.deb" + cee: "{{ __checkmk_agent_host_tmp_dir }}/check-mk-agent_{{ checkmk_agent_version }}-generic.deb" + host: "{{ __checkmk_agent_host_tmp_dir }}/check-mk-agent_{{ checkmk_agent_version }}-{{ inventory_hostname }}.deb" diff --git a/vars/RedHat.yml b/vars/RedHat.yml new file mode 100644 index 0000000..25b2290 --- /dev/null +++ b/vars/RedHat.yml @@ -0,0 +1,11 @@ +--- +__checkmk_agent_host_tmp_dir: "/tmp" + +__checkmk_agent_agent: + url: + cre: "{{ __checkmk_agent_site_url }}/check_mk/agents/check-mk-agent-{{ checkmk_agent_version }}-1.noarch.rpm" + cee: "{{ __checkmk_agent_site_url }}/check_mk/api/1.0/domain-types/agent/actions/download_by_host/invoke" + file: + cre: "{{ __checkmk_agent_host_tmp_dir }}/check-mk-agent-{{ checkmk_agent_version }}-1.noarch-vanilla.rpm" + cee: "{{ __checkmk_agent_host_tmp_dir }}/check-mk-agent-{{ checkmk_agent_version }}-1.noarch-generic.rpm" + host: "{{ __checkmk_agent_host_tmp_dir }}/check-mk-agent-{{ checkmk_agent_version }}-1.noarch-{{ inventory_hostname }}.rpm" diff --git a/vars/Suse.yml b/vars/Suse.yml new file mode 100644 index 0000000..25b2290 --- /dev/null +++ b/vars/Suse.yml @@ -0,0 +1,11 @@ +--- +__checkmk_agent_host_tmp_dir: "/tmp" + +__checkmk_agent_agent: + url: + cre: "{{ __checkmk_agent_site_url }}/check_mk/agents/check-mk-agent-{{ checkmk_agent_version }}-1.noarch.rpm" + cee: "{{ __checkmk_agent_site_url }}/check_mk/api/1.0/domain-types/agent/actions/download_by_host/invoke" + file: + cre: "{{ __checkmk_agent_host_tmp_dir }}/check-mk-agent-{{ checkmk_agent_version }}-1.noarch-vanilla.rpm" + cee: "{{ __checkmk_agent_host_tmp_dir }}/check-mk-agent-{{ checkmk_agent_version }}-1.noarch-generic.rpm" + host: "{{ __checkmk_agent_host_tmp_dir }}/check-mk-agent-{{ checkmk_agent_version }}-1.noarch-{{ inventory_hostname }}.rpm" diff --git a/vars/Windows.yml b/vars/Windows.yml new file mode 100644 index 0000000..29833d9 --- /dev/null +++ b/vars/Windows.yml @@ -0,0 +1,13 @@ +--- +__checkmk_agent_host_tmp_dir: "C:\\Windows\\Temp" +__checkmk_agent_controller_binary_path: "C:\\Program Files (x86)\\checkmk\\service\\cmk-agent-ctl.exe" +__checkmk_agent_binary_path: "C:\\Program Files (x86)\\checkmk\\service\\check_mk_agent.exe" + +__checkmk_agent_agent: + url: + cre: "{{ __checkmk_agent_site_url }}/check_mk/agents/windows/check_mk_agent.msi" + cee: "{{ __checkmk_agent_site_url }}/check_mk/api/1.0/domain-types/agent/actions/download_by_host/invoke" + file: + cre: "{{ __checkmk_agent_host_tmp_dir }}\\check-mk-agent_{{ checkmk_agent_version }}.msi" + cee: "{{ __checkmk_agent_host_tmp_dir }}\\check-mk-agent_{{ checkmk_agent_version }}.msi" + host: "{{ __checkmk_agent_host_tmp_dir }}\\check-mk-agent_{{ checkmk_agent_version }}-{{ inventory_hostname }}.msi" diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..f2fce78 --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,35 @@ +--- +__checkmk_agent_site_url: "{{ checkmk_agent_server_protocol }}://{{ checkmk_agent_server }}:{{ checkmk_agent_server_port }}/{{ checkmk_agent_site }}" + +__checkmk_agent_auth: |- + {% if checkmk_agent_secret is defined and checkmk_agent_secret | length > 0 %}{{ checkmk_agent_secret }}{% else %}{{ checkmk_agent_pass }}{% endif %} + +# Due to inconsistent naming of editions, we normalize them here for convenience +# Due to inconsistent naming of editions, we normalize them here for convenience. +__checkmk_var_legacy_edition_mapping: + cre: raw + cfe: free + cee: enterprise + cce: cloud + cme: managed + +# Due to renaming of editions starting with 2.5.0, we normalize them here for convenience. Again. +__checkmk_var_modern_edition_mapping: + cre: community + cee: pro + cce: ultimate + cme: ultimatemt + cse: cloud + +# Bringing the above two mappings back together. +__checkmk_agent_edition_mapping: >- + {{ + ( (checkmk_agent_version | regex_replace('p.*', '')) is version('2.5.0', '<') ) + | ternary(__checkmk_var_legacy_edition_mapping, __checkmk_var_modern_edition_mapping) + }} + +__checkmk_agent_files_mapping: + Debian: linux_deb + RedHat: linux_rpm + Suse: linux_rpm + Windows: windows_msi