-
Notifications
You must be signed in to change notification settings - Fork 321
Description
SUMMARY
In zabbix_agent/defaults/main.yml, the variable zabbix_agent_win_package is defined as :
zabbix_agent_win_package: "{{ zabbix_agent2 | ternary('zabbix_agent2', 'zabbix_agent') }}-{{ zabbix_agent_version_long }}-windows-{{ _zabbix_agent_win_arch[ansible_facts.architecture] }}-openssl.msi"
On french Windows Server, ansible_facts.architecture is "64 bits" and not "64-bits" which is not known in _zabbix_agent_win_arch (from var/windows.yml)
ansible_facts for my server:
architecture: 64 bits
architecture2: x86_64
ISSUE TYPE
- Bug Report
COMPONENT NAME
Zabbix-Agent role
ANSIBLE VERSION
ansible [core 2.16.13]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /opt/semaphore/apps/ansible/9.4.0/venv/lib/python3.11/site-packages/ansible
ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
executable location = /opt/semaphore/apps/ansible/9.4.0/venv/bin/ansible
python version = 3.11.11 (main, Dec 6 2024, 11:15:21) [GCC 13.2.1 20231014] (/opt/semaphore/apps/ansible/9.4.0/venv/bin/python3)
jinja version = 3.1.4
libyaml = True
CONFIGURATION
CONFIG_FILE() = /etc/ansible/ansible.cfg
DEFAULT_LOAD_CALLBACK_PLUGINS(/etc/ansible/ansible.cfg) = True
DEFAULT_STDOUT_CALLBACK(/etc/ansible/ansible.cfg) = yaml
HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False
OS / ENVIRONMENT / Zabbix Version
Zabbix 7.4.2
Target OS : Windows Server 2019 (FR)
STEPS TO REPRODUCE
Just need to try to install the zabbix agent 2 on a windows serveur 2019 (FR)
> - name: Install / Update Zabbix Agent
> hosts: "mywindows2019FRHost"
> become: "{{ ansible_facts['os_family'] != 'Windows' }}"
> gather_facts: true
> vars:
> # Configuration Zabbix Server
> zabbix_server_host: "MyZabbixServerHost"
> zabbix_server_port: 10051
>
> # Variables spécifiques à Zabbix Agent 2
> zabbix_agent_version: "7.4"
> zabbix_agent_version_check: false
> zabbix_agent2: true
> zabbix_agent_server: "{{ zabbix_server_host }}"
> zabbix_agent_serveractive: "{{ zabbix_server_host }}:{{ zabbix_server_port }}"
> zabbix_agent_hostname: "{{ inventory_hostname }}"
> zabbix_agent_tlsconnect: "psk"
> zabbix_agent_tlsaccept: "psk"
> zabbix_agent_tlspsk_auto: true
>
> # Configuration additionnelle
> zabbix_agent2_listenport: 10050
> zabbix_agent2_enableremotecommands: 1
> zabbix_agent2_logremotecommands: 1
>
> # Variables pour différentes distributions
> zabbix_repo_yum_enabled: 1
> zabbix_repo_yum_gpgcheck: 1
> zabbix_agent_ip: "{{ ansible_host }}"
> roles:
> - role: community.zabbix.zabbix_agent
EXPECTED RESULTS
Should install the zabbix agent 2 7.4 on the windows server
ACTUAL RESULTS
The task fails has there is no "64 bits" key in the _zabbix_agent_win_arch map
ansible_facts for my server:
architecture: 64 bits
architecture2: x86_64
The task includes an option with an undefined variable. The error was: {{ zabbix_agent_download_base_url }}/{{ zabbix_agent_version }}/{{ zabbix_agent_version_long }}/{{ zabbix_agent_win_package }}: {{ zabbix_agent2 | ternary('zabbix_agent2', 'zabbix_agent') }}-{{ zabbix_agent_version_long }}-windows-{{ _zabbix_agent_win_arch[ansible_facts.architecture] }}-openssl.msi: 'dict object' has no attribute '64 bits'. 'dict object' has no attribute '64 bits'. {{ zabbix_agent2 | ternary('zabbix_agent2', 'zabbix_agent') }}-{{ zabbix_agent_version_long }}-windows-{{ _zabbix_agent_win_arch[ansible_facts.architecture] }}-openssl.msi: 'dict object' has no attribute '64 bits'. 'dict object' has no attribute '64 bits'. {{ zabbix_agent_download_base_url }}/{{ zabbix_agent_version }}/{{ zabbix_agent_version_long }}/{{ zabbix_agent_win_package }}: {{ zabbix_agent2 | ternary('zabbix_agent2', 'zabbix_agent') }}-{{ zabbix_agent_version_long }}-windows-{{ _zabbix_agent_win_arch[ansible_facts.architecture] }}-openssl.msi: 'dict object' has no attribute '64 bits'. 'dict object' has no attribute '64 bits'. {{ zabbix_agent2 | ternary('zabbix_agent2', 'zabbix_agent') }}-{{ zabbix_agent_version_long }}-windows-{{ _zabbix_agent_win_arch[ansible_facts.architecture] }}-openssl.msi: 'dict object' has no attribute '64 bits'. 'dict object' has no attribute '64 bits'
The error appears to be in '/tmp/semaphore/.ansible/collections/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/install-Windows.yml': line 66, column 7, but may be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: Download Zabbix Agent
^ here