Skip to content

Commit

Permalink
Reworked Include logic similar to the Alias logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Thulium-Drake committed Jul 9, 2024
1 parent 28c4921 commit 8429f09
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 11 additions & 1 deletion roles/zabbix_agent/templates/agent.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,17 @@ DenyKey={{ item }}
{{ (zabbix_agent_hostmetadataitem is defined and zabbix_agent_hostmetadataitem is not none) | ternary('', '# ') }}HostMetadataItem={{ zabbix_agent_hostmetadataitem | default('') }}
{{ (zabbix_agent_hostname is defined and zabbix_agent_hostname is not none) | ternary('', '# ') }}Hostname={{ zabbix_agent_hostname | default('') }}
{{ (zabbix_agent_hostnameitem is defined and zabbix_agent_hostnameitem is not none) | ternary('', '# ') }}HostnameItem={{ zabbix_agent_hostnameitem | default('') }}
{{ (zabbix_agent_include is defined and zabbix_agent_include is not none) | ternary('', '# ') }}Include={{ zabbix_agent_include | default('') }}
{% if zabbix_agent_include is defined and zabbix_agent_include %}
{% if zabbix_agent_include is string %}
Include={{ zabbix_agent_include }}
{% else %}
{% for item in zabbix_agent_include %}
Include={{ item }}
{% endfor %}
{% endif %}
{% else %}
# Include=
{% endif %}
{% if not zabbix_agent2 %}
{{ (zabbix_agent_listenbacklog is defined and zabbix_agent_listenbacklog is not none) | ternary('', '# ') }}ListenBacklog={{ zabbix_agent_listenbacklog | default('') }}
{% endif %}
Expand Down
4 changes: 3 additions & 1 deletion roles/zabbix_agent/vars/agent2_vars.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
_pidfile: /var/run/zabbix/zabbix_agent2.pid
_logfile: /var/log/zabbix/zabbix_agent2.log
_include: /etc/zabbix/zabbix_agent2.d
_include:
- /etc/zabbix/zabbix_agent2.d
- /etc/zabbix/zabbix_agent2.d/plugins.d
_tls_subject: "{{ zabbix_agent_tlsservercertsubject | default(omit) }}" # FIXME this is not correct and should be removed with 2.0.0, here only to prevent regression
_win_package: zabbix_agent2-{{ zabbix_version_long }}-windows-amd64-openssl-static.zip
_win_download_link: "{{ zabbix_win_download_url }}/{{ zabbix_version_long | regex_search('^\\d+\\.\\d+') }}/{{ zabbix_version_long }}/{{ zabbix2_win_package }}"
Expand Down

0 comments on commit 8429f09

Please sign in to comment.