Skip to content

Commit

Permalink
Fix problems with Zabbix Agent 2 (ansible-collections#1259)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroenvermeulen authored and pyrodie18 committed Jun 4, 2024
1 parent 8f8a979 commit 0e53bf4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
7 changes: 7 additions & 0 deletions changelogs/fragments/pr_1259.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
minor_changes:
- zabbix_agent - added 10 retries to agent API calls to workaround connection problems on macOS
bugfixes:
- zabbix_agent - in ``zabbix_agent_interfaces`` directly use ``zabbix_agent_listenport``, which does already contains
the agent2 value if needed
- zabbix_agent - fix error when ``zabbix_agent_tlsaccept`` is not set
- zabbix_agent - fix error when ``zabbix_agent_tlsconnect`` is not set
2 changes: 1 addition & 1 deletion roles/zabbix_agent/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ zabbix_agent_interfaces:
useip: "{{ zabbix_useuip }}"
ip: "{{ zabbix_agent_ip }}"
dns: "{{ ansible_fqdn }}"
port: "{{ (zabbix_agent2 == True) | ternary(zabbix_agent2_listenport, zabbix_agent_listenport) }}"
port: "{{ zabbix_agent_listenport }}"

# Zabbix configuration variables
zabbix_agent_listeninterface:
Expand Down
7 changes: 5 additions & 2 deletions roles/zabbix_agent/tasks/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- zabbix_api_create_hostgroup | bool
register: zabbix_api_hostgroup_created
until: zabbix_api_hostgroup_created is succeeded
retries: 10
delegate_to: "{{ zabbix_api_server_host }}"
tags:
- api
Expand All @@ -27,8 +28,8 @@
tls_psk_identity: "{{ zabbix_agent_tlspskidentity | default(omit) }}"
tls_issuer: "{{ zabbix_agent_tlsservercertissuer | default(omit) }}"
tls_subject: "{{ zabbix_agent_tls_subject | default(omit) }}"
tls_accept: "{{ zabbix_agent_tls_config[zabbix_agent_tlsaccept if zabbix_agent_tlsaccept else 'unencrypted'] }}"
tls_connect: "{{ zabbix_agent_tls_config[zabbix_agent_tlsconnect if zabbix_agent_tlsconnect else 'unencrypted'] }}"
tls_accept: "{{ zabbix_agent_tls_config[zabbix_agent_tlsaccept | default('unencrypted')] }}"
tls_connect: "{{ zabbix_agent_tls_config[zabbix_agent_tlsconnect | default('unencrypted')] }}"
description: "{{ zabbix_agent_description | default(omit) }}"
inventory_zabbix: "{{ zabbix_agent_inventory_zabbix | default({}) }}"
ipmi_authtype: "{{ zabbix_agent_ipmi_authtype | default(omit) }}"
Expand All @@ -38,6 +39,7 @@
tags: "{{ zabbix_agent_tags | default(omit) }}"
register: zabbix_api_host_created
until: zabbix_api_host_created is succeeded
retries: 10
delegate_to: "{{ zabbix_api_server_host }}"
changed_when: false
tags:
Expand All @@ -54,6 +56,7 @@
- item.macro_key is defined
register: zabbix_api_hostmarcro_created
until: zabbix_api_hostmarcro_created is succeeded
retries: 10
delegate_to: "{{ zabbix_api_server_host }}"
tags:
- api

0 comments on commit 0e53bf4

Please sign in to comment.