You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When running checkmk.general.agent role over Linux host, "Register Agent for TLS directly." is skipped
TASK [checkmk.general.agent : Linux: Register Agent for TLS directly.] *****************************************************************************************************************
skipping: [REDACTED] => {"changed": false, "false_condition": "__checkmk_agent_controller_binary.stat.exists | bool\nand checkmk_agent_tls | bool\nand not checkmk_agent_delegate_registration | bool\nand (__checkmk_agent_auth is defined and __checkmk_agent_auth | length)\nand not checkmk_agent_registration_server + '/' + checkmk_agent_registration_site in __checkmk_agent_registered_connections.stdout\n", "skip_reason": "Conditional result was False"}
because of the following when cause:
and not checkmk_agent_registration_server + '/' + checkmk_agent_registration_site in __checkmk_agent_registered_connections.stdout
in roles/agent/tasks/Linux.yml
- name: "{{ ansible_system }}: Register Agent for TLS directly."
become: true
ansible.builtin.shell: |
cmk-agent-ctl register -H {{ checkmk_agent_host_name }} \
-s {{ checkmk_agent_registration_server }} -i {{ checkmk_agent_registration_site }} \
-U {{ checkmk_agent_user }} -P {{ __checkmk_agent_auth }} --trust-cert
no_log: "{{ checkmk_agent_no_log | bool }}"
register: __checkmk_agent_tls_state
when: |
__checkmk_agent_controller_binary.stat.exists | bool
and checkmk_agent_tls | bool
and not checkmk_agent_delegate_registration | bool
and (__checkmk_agent_auth is defined and __checkmk_agent_auth | length)
and not checkmk_agent_registration_server + '/' + checkmk_agent_registration_site in __checkmk_agent_registered_connections.stdout
changed_when: "'Registration complete' in __checkmk_agent_tls_state.stdout"
This can probably be caused by "__checkmk_agent_registered_connections" not being registered in CRE due to the cmk-update-agent binary not existing, resulting in no respective file at /var/lib/check_mk_agent/cache/plugins_cmk-update-agent.cache:
TASK [checkmk.general.agent : Linux: Read Updater State.] ******************************************************************************************************************************
ok: [REDACTED] => {"changed": false, "cmd": ["cat", "/var/lib/check_mk_agent/cache/plugins_cmk-update-agent.cache"], "delta": "0:00:00.005868", "end": "2025-01-23 13:37:59.456444", "failed_when_result": false, "msg": "non-zero return code", "rc": 1, "start": "2025-01-23 13:37:59.450576", "stderr": "cat: /var/lib/check_mk_agent/cache/plugins_cmk-update-agent.cache: No such file or directory", "stderr_lines": ["cat: /var/lib/check_mk_agent/cache/plugins_cmk-update-agent.cache: No such file or directory"], "stdout": "", "stdout_lines": []
As soon as the reported when cause is removed from the file, the agent is registered just fine:
Describe the bug
When running checkmk.general.agent role over Linux host, "Register Agent for TLS directly." is skipped
because of the following when cause:
and not checkmk_agent_registration_server + '/' + checkmk_agent_registration_site in __checkmk_agent_registered_connections.stdout
in roles/agent/tasks/Linux.yml
This can probably be caused by "__checkmk_agent_registered_connections" not being registered in CRE due to the cmk-update-agent binary not existing, resulting in no respective file at /var/lib/check_mk_agent/cache/plugins_cmk-update-agent.cache:
As soon as the reported when cause is removed from the file, the agent is registered just fine:
Component Name
Component Name: registration
Ansible Version
Checkmk Version and Edition
2.3.0p24 (CRE)
Collection Version
To Reproduce
Steps to reproduce the behavior:
Run checkmk.general.agent over a Linux-based host.
Expected behavior
Agent TLS registartion passed
Actual behavior
Agent TLS registartion skipped
Minimum reproduction example
Additional context
Configuration:
The text was updated successfully, but these errors were encountered: