Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix setup download status code #623

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelogs/fragments/agent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bugfixes:
- Agent role - For Windows hosts the download of correct setup files was broken
due to a mixup in the modules used to fetch the files. The role would always
fall back to the GENERIC agent, even if a specific agent was available.
This is fixed now.
8 changes: 4 additions & 4 deletions roles/agent/tasks/Win32NT-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@
register: __checkmk_agent_host_download_state
# This task may fail, as we fall back to the generic agent in that case
failed_when: 'false'
changed_when: __checkmk_agent_host_download_state.status_code is defined and __checkmk_agent_host_download_state.status_code == 200
changed_when: __checkmk_agent_host_download_state.status is defined and __checkmk_agent_host_download_state.status == 200
delegate_to: "{{ checkmk_agent_delegate_download }}"

- name: "{{ ansible_system }}: Set Fact: Agent State: host-specific."
ansible.builtin.set_fact:
checkmk_agent_host_specific: >-
{{ (__checkmk_agent_host_download_state.status_code is defined and __checkmk_agent_host_download_state.status_code == 200) | bool }}
{{ (__checkmk_agent_host_download_state.status is defined and __checkmk_agent_host_download_state.status == 200) | bool }}

- name: "{{ ansible_system }}: Download folder-specific {{ checkmk_agent_edition | upper }} Agent (delegated)."
ansible.builtin.uri:
Expand All @@ -149,13 +149,13 @@
and not checkmk_agent_host_specific | bool
retries: 3
failed_when: 'false'
changed_when: __checkmk_agent_folder_download_state.status_code is defined and __checkmk_agent_folder_download_state.status_code == 200
changed_when: __checkmk_agent_folder_download_state.status is defined and __checkmk_agent_folder_download_state.status == 200
delegate_to: "{{ checkmk_agent_delegate_download }}"

- name: "{{ ansible_system }}: Set Fact: Agent State: folder-specific."
ansible.builtin.set_fact:
checkmk_agent_folder_specific: >-
{{ (__checkmk_agent_folder_download_state.status_code is defined and __checkmk_agent_folder_download_state.status_code == 200) | bool }}
{{ (__checkmk_agent_folder_download_state.status is defined and __checkmk_agent_folder_download_state.status == 200) | bool }}

- name: "{{ ansible_system }}: Download GENERIC {{ checkmk_agent_edition | upper }} Agent (delegated)."
ansible.builtin.uri:
Expand Down
Loading