{{ ansible_managed | comment }}
# This is a configuration file for Zabbix Agent
# To get more information about Zabbix, visit http://www.zabbix.com

# This configuration file is "minimalized", which means all the original comments 
# are removed. The full documentation for your Zabbix Agent can be found here:
# https://www.zabbix.com/documentation/{{ zabbix_agent_version }}/en/manual/appendix/config/zabbix_agentd{{ "_win" if ansible_os_family == "Windows" else "" }}

{% if ansible_os_family != "Windows" %}
PidFile={{ zabbix_agent_pidfile }}
{% endif %}
{% if zabbix_agent_version is version('3.0', '>=') %}
LogType={{ zabbix_agent_logtype }}
{% endif %}
{% if ansible_os_family == "Windows" %}
LogFile={{ zabbix_agent_win_logfile }}
{% else %}
LogFile={{ zabbix_agent_logfile }}
{% endif %}
LogFileSize={{ zabbix_agent_logfilesize }}
DebugLevel={{ zabbix_agent_debuglevel }}
{% if zabbix_agent_sourceip is defined and zabbix_agent_sourceip %}
SourceIP={{ zabbix_agent_sourceip }}
{% endif %}
{% if zabbix_agent_version is version('6.0', '<=') %}
EnableRemoteCommands={{ zabbix_agent_enableremotecommands }}
{% else %}
{% if zabbix_agent_allowkeys is defined and zabbix_agent_allowkeys %}
AllowKey={{ zabbix_agent_allowkeys }}
{% endif %}
{% if zabbix_agent_denykeys is defined and zabbix_agent_denykeys %}
DenyKey={{ zabbix_agent_denykeys }}
{% endif %}
{% endif %}
LogRemoteCommands={{ zabbix_agent_logremotecommands }}
Server={{ zabbix_agent_server }}
ListenPort={{ zabbix_agent_listenport }}
{% if zabbix_agent_listenip is defined and zabbix_agent_listenip !='0.0.0.0' and zabbix_agent_listenip %}
ListenIP={{ zabbix_agent_listenip }}
{% endif %}
StartAgents={{ zabbix_agent_startagents }}
ServerActive={{ zabbix_agent_serveractive }}
{% if zabbix_agent_hostname is defined and zabbix_agent_hostname %}
Hostname={{ zabbix_agent_hostname }}
{% endif %}
{% if zabbix_agent_hostnameitem is defined and zabbix_agent_hostnameitem %}
HostnameItem={{ zabbix_agent_hostnameitem }}
{% endif %}
{% if zabbix_agent_hostmetadata is defined and zabbix_agent_hostmetadata %}
HostMetadata={{ zabbix_agent_hostmetadata }}
{% endif %}
{% if zabbix_agent_hostmetadataitem is defined and zabbix_agent_hostmetadataitem %}
HostMetadataItem={{ zabbix_agent_hostmetadataitem }}
{% endif %}
{% if zabbix_agent_allow_key is defined and zabbix_agent_allow_key %}
{% for item in zabbix_agent_allow_key %}
AllowKey={{ item }}
{% endfor %}
{% endif %}
{% if zabbix_agent_deny_key is defined and zabbix_agent_deny_key %}
{% for item in zabbix_agent_deny_key %}
DenyKey={{ item }}
{% endfor %}
{% endif %}
RefreshActiveChecks={{ zabbix_agent_refreshactivechecks }}
BufferSend={{ zabbix_agent_buffersend }}
BufferSize={{ zabbix_agent_buffersize }}
MaxLinesPerSecond={{ zabbix_agent_maxlinespersecond }}
{% if zabbix_agent_version is version_compare('6.2', '>=') %}
HeartbeatFrequency={{ zabbix_agent_heartbeatfrequency }}
{% endif %}
{% if zabbix_agent_zabbix_alias is defined and zabbix_agent_zabbix_alias %}
{% if zabbix_agent_zabbix_alias is string %}
Alias={{ zabbix_agent_zabbix_alias }}
{% else %}
{% for item in zabbix_agent_zabbix_alias %}
Alias={{ item }}
{% endfor %}
{% endif %}
{% endif %}
Timeout={{ zabbix_agent_timeout }}
{% if ansible_os_family != "Windows" %}
AllowRoot={{ zabbix_agent_allowroot }}
{% endif %}
{% if zabbix_agent_runas_user is defined and zabbix_agent_runas_user %}
User={{ zabbix_agent_runas_user }}
{% endif %}
{% if ansible_os_family == "Windows" %}
Include={{ zabbix_agent_win_include }}
{% else %}
Include={{ zabbix_agent_include }}/{{ zabbix_agent_include_pattern }}
{% endif %}
{% if zabbix_agent_additional_include is defined and zabbix_agent_additional_include is iterable and zabbix_agent_additional_include is not string %}
{% for include in zabbix_agent_additional_include %}
Include={{ include }}
{% endfor %}
{% endif %}
UnsafeUserParameters={{ zabbix_agent_unsafeuserparameters }}
{% if zabbix_agent_version is version_compare('2.2', '>=') %}
{% if ansible_os_family != "Windows" %}
LoadModulePath={{ zabbix_agent_loadmodulepath }}
{% endif %}
{% endif %}
{% if zabbix_agent_loadmodule is defined and zabbix_agent_loadmodule %}
{% if zabbix_agent_loadmodule is string %}
LoadModule={{ zabbix_agent_loadmodule }}
{% else %}
{% for module in zabbix_agent_loadmodule %}
LoadModule={{ module }}
{% endfor %}
{% endif %}
{% endif %}
{% if zabbix_agent_version is version_compare('3.0', '>=') %}
{% if zabbix_agent_tlsconnect is defined and zabbix_agent_tlsconnect %}
TLSConnect={{ zabbix_agent_tlsconnect }}
{% endif %}
{% if zabbix_agent_tlsaccept is defined and zabbix_agent_tlsaccept %}
TLSAccept={{ zabbix_agent_tlsaccept }}
{% endif %}
{% if zabbix_agent_tlscafile is defined and zabbix_agent_tlscafile %}
TLSCAFile={{ zabbix_agent_tlscafile }}
{% endif %}
{% if zabbix_agent_tlscrlfile is defined and zabbix_agent_tlscrlfile %}
TLSCRLFile={{ zabbix_agent_tlscrlfile }}
{% endif %}
{% if zabbix_agent_tlsservercertissuer is defined and zabbix_agent_tlsservercertissuer %}
TLSServerCertIssuer={{ zabbix_agent_tlsservercertissuer }}
{% endif %}
{% if zabbix_agent_tlsservercertsubject is defined and zabbix_agent_tlsservercertsubject %}
TLSServerCertSubject={{ zabbix_agent_tlsservercertsubject }}
{% endif %}
{% if zabbix_agent_tlscertfile is defined and zabbix_agent_tlscertfile %}
TLSCertFile={{ zabbix_agent_tlscertfile }}
{% endif %}
{% if zabbix_agent_tlskeyfile is defined and zabbix_agent_tlskeyfile %}
TLSKeyFile={{ zabbix_agent_tlskeyfile }}
{% endif %}
{% if zabbix_agent_tlspskidentity is defined and zabbix_agent_tlspskidentity %}
TLSPSKIdentity={{ zabbix_agent_tlspskidentity }}
{% endif %}
{% if zabbix_agent_tlspskfile is defined and zabbix_agent_tlspskfile %}
TLSPSKFile={{ zabbix_agent_tlspskfile }}
{% endif %}
{% endif %}
{% if zabbix_agent_version is version('6.0', '>=') %}
{% if zabbix_agent_listenbacklog is defined and zabbix_agent_listenbacklog %}
ListenBacklog={{ zabbix_agent_listenbacklog }}
{% endif %}
{% endif %}
