Closed david-sieg closed 1 month ago
Zabbix Agent2 deployment fails due to wrong definition of config file in task.
- name: "Windows | Set variables specific to Zabbix" ansible.builtin.set_fact: zabbix_win_svc_name: Zabbix Agent zabbix_win_exe_path: '{{ zabbix_win_install_dir }}\bin\zabbix_agentd.exe' zabbix_win_config_name: "zabbix_agentd.conf" zabbix2_win_svc_name: Zabbix Agent 2 zabbix2_win_exe_path: '{{ zabbix_win_install_dir }}\bin\zabbix_agent2.exe' zabbix2_win_config_name: "zabbix_agentd2.conf" tags: - always
Using older version resolves problem, due to correct defined var.
Filename is "zabbix_agent2.conf" after extraction of archive not "zabbix_agentd2.conf".
win_command tasks fails:
- name: "Windows | Register Service" ansible.windows.win_command: '"{{ zabbix_win_exe_path }}" --config "{{ zabbix_win_install_dir_conf }}\{{ zabbix_win_config_name }}" --install' when: not zabbix_windows_service.exists tags: - service
Ansible 2.15
Windows Server 2022
Deploy of zabbix-agent-role with newest collection version.
Successful deployment of Zabbix Agent.
fatal: [windows-test.domain.local]: FAILED! => {"changed": true, "cmd": "\"C:\\Program Files\\Zabbix Agent 2\\\\bin\\zabbix_agent2.exe\" --config \"C:\\Program Files\\Zabbix Agent 2\\\\conf\\zabbix_agentd2.conf\" --install", "delta": "0:00:01.316045", "end": "2024-06-03 06:52:35.137037", "msg": "non-zero return code", "rc": 1, "start": "2024-06-03 06:52:33.820992", "stderr": "zabbix_agent2 [456]: ERROR: cannot open configuration file: open C:\\Program Files\\Zabbix Agent 2\\\\conf\\zabbix_agentd2.conf: The system cannot find the file specified.\n", "stderr_lines": ["zabbix_agent2 [456]: ERROR: cannot open configuration file: open C:\\Program Files\\Zabbix Agent 2\\\\conf\\zabbix_agentd2.conf: The system cannot find the file specified."], "stdout": "", "stdout_lines": []}
PR #1267
Should fixe the issue.
SUMMARY
Zabbix Agent2 deployment fails due to wrong definition of config file in task.
Using older version resolves problem, due to correct defined var.
Filename is "zabbix_agent2.conf" after extraction of archive not "zabbix_agentd2.conf".
ISSUE TYPE
COMPONENT NAME
win_command tasks fails:
ANSIBLE VERSION
Ansible 2.15
OS / ENVIRONMENT / Zabbix Version
Windows Server 2022
STEPS TO REPRODUCE
Deploy of zabbix-agent-role with newest collection version.
EXPECTED RESULTS
Successful deployment of Zabbix Agent.
ACTUAL RESULTS