Skip to content

Commit

Permalink
Still working
Browse files Browse the repository at this point in the history
  • Loading branch information
pyrodie18 committed Jun 12, 2024
1 parent 0863c00 commit bd6ed0d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
9 changes: 3 additions & 6 deletions roles/zabbix_agent/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ zabbix_agent_tlspsk_auto: false
zabbix_agent_tlspskfile: /etc/zabbix/tls_psk_auto.secret
zabbix_agent_unsafeuserparameters: false
zabbix_agent_runas_user: zabbix
zabbix_agent_loadmodulepath: ${libdir}/modules
zabbix_agent_logremotecommands: false
zabbix_agent_startagents: 3

zabbix_agent_tlspskidentity_file: "/etc/zabbix/tls_psk_auto.identity"
# Selinux related vars
Expand Down Expand Up @@ -86,7 +89,6 @@ zabbix_agent_interfaces:
dns: "{{ ansible_fqdn }}"
port: "{{ zabbix_agent_listenport }}"


# statusportzabbix_agent_zabbix_alias: # Deprecate after 3.0
zabbix_agent_userparameters_templates_src: "userparameters"
zabbix_agent_userparameters_scripts_src: "scripts"
Expand All @@ -103,11 +105,6 @@ zabbix_agent_ipmi_privilege: 2

####### Agent 1 Stuff Only

zabbix_agent_loadmodulepath: ${libdir}/modules
zabbix_agent_logremotecommands: 0
zabbix_agent_maxlinespersecond: 100
zabbix_agent_startagents: 3

# Windows/macOS Related
zabbix_version_long: 5.2.4

Expand Down
16 changes: 10 additions & 6 deletions roles/zabbix_agent/templates/agent.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ AllowKey={{ item }}
# AllowKey=
{% endif %}
{% if not zabbix_agent2 and ansible_os_family != "Windows" %}
{{ (zabbix_agent_allowroot is defined and zabbix_agent_allowroot is not none) | ternary('', '# ') }}AllowRoot={{ zabbix_agent_allowroot | default('') }}
{{ (zabbix_agent_allowroot is defined and zabbix_agent_allowroot is not none) | ternary('', '# ') }}AllowRoot={{ zabbix_agent_allowroot | default (false) | ternary('1', '0') }}
{% endif %}
{{ (zabbix_agent_buffersend is defined and zabbix_agent_buffersend is not none) | ternary('', '# ') }}BufferSend={{ zabbix_agent_buffersend | default('') }}
{{ (zabbix_agent_buffersize is defined and zabbix_agent_buffersize is not none) | ternary('', '# ') }}BufferSize={{ zabbix_agent_buffersize | default('') }}
Expand All @@ -48,12 +48,14 @@ DenyKey={{ item }}
{% else %}
# DenyKey=
{% endif %}
{{ (zabbix_agent_enablepersistentbuffer is defined and zabbix_agent_enablepersistentbuffer is not none) | ternary('', '# ') }}EnablePersistentBuffer={{ zabbix_agent_enablepersistentbuffer | default('') }}
{% if zabbix_agent2 %}
{{ (zabbix_agent_enablepersistentbuffer is defined and zabbix_agent_enablepersistentbuffer is not none) | ternary('', '# ') }}EnablePersistentBuffer={{ zabbix_agent_enablepersistentbuffer | default (false) | ternary('1', '0') }}
{% endif %}
{% if not zabbix_agent2 %}
{{ (zabbix_agent_enableremotecommands is defined and zabbix_agent_enableremotecommands is not none) | ternary('', '# ') }}EnableRemoteCommands={{ zabbix_agent_enableremotecommands | default('') }}
{{ (zabbix_agent_enableremotecommands is defined and zabbix_agent_enableremotecommands is not none) | ternary('', '# ') }}EnableRemoteCommands={{ zabbix_agent_enableremotecommands | default (false) | ternary('1', '0') }}
{% endif %}
{% if zabbix_agent2 %}
{{ (zabbix_agent_forceactivechecksonstart is defined and zabbix_agent_forceactivechecksonstart is not none) | ternary('', '# ') }}ForceActiveChecksOnStart={{ zabbix_agent_forceactivechecksonstart | default('') }}
{{ (zabbix_agent_forceactivechecksonstart is defined and zabbix_agent_forceactivechecksonstart is not none) | ternary('', '# ') }}ForceActiveChecksOnStart={{ zabbix_agent_forceactivechecksonstart | default (false) | ternary('1', '0') }}
{% endif %}
{% if zabbix_agent_version is version_compare('6.2', '>=') %}
{{ (zabbix_agent_heartbeatfrequency is defined and zabbix_agent_heartbeatfrequency is not none) | ternary('', '# ') }}HeartbeatFrequency={{ zabbix_agent_heartbeatfrequency | default('') }}
Expand All @@ -77,7 +79,7 @@ DenyKey={{ item }}
{{ (zabbix_agent_logfile is defined and zabbix_agent_logfile is not none) | ternary('', '# ') }}LogFile={{ zabbix_agent_logfile | default('') }}
{{ (zabbix_agent_logfilesize is defined and zabbix_agent_logfilesize is not none) | ternary('', '# ') }}LogFileSize={{ zabbix_agent_logfilesize | default('') }}
{% if not zabbix_agent2 %}
{{ (zabbix_agent_logremotecommands is defined and zabbix_agent_logremotecommands is not none) | ternary('', '# ') }}LogRemoteCommands={{ zabbix_agent_logremotecommands | default('') }}
{{ (zabbix_agent_logremotecommands is defined and zabbix_agent_logremotecommands is not none) | ternary('', '# ') }}LogRemoteCommands={{ zabbix_agent_logremotecommands | default (false) | ternary('1', '0') }}
{% endif %}
{{ (zabbix_agent_logtype is defined and zabbix_agent_logtype is not none) | ternary('', '# ') }}LogType={{ zabbix_agent_logtype | default('') }}
{% if not zabbix_agent2 %}
Expand All @@ -104,8 +106,10 @@ Plugins.{{ my_name }}.{{ param }}={{ value }}
{% endfor %}
{% endfor %}
{% endif %}
{% if zabbix_agent2 %}
{{ (zabbix_agent_pluginsocket is defined and zabbix_agent_pluginsocket is not none) | ternary('', '# ') }}PluginSocket={{ zabbix_agent_pluginsocket | default('') }}
{{ (zabbix_agent_plugintimeout is defined and zabbix_agent_plugintimeout is not none) | ternary('', '# ') }}PluginTimeout={{ zabbix_agent_plugintimeout | default('') }}
{% endif %}
{{ (zabbix_agent_refreshactivechecks is defined and zabbix_agent_refreshactivechecks is not none) | ternary('', '# ') }}RefreshActiveChecks={{ zabbix_agent_refreshactivechecks | default('') }}
{{ (zabbix_agent_server is defined and zabbix_agent_server is not none) | ternary('', '# ') }}Server={{ zabbix_agent_server | default('') }}
{{ (zabbix_agent_serveractive is defined and zabbix_agent_serveractive is not none) | ternary('', '# ') }}ServerActive={{ zabbix_agent_serveractive | default('') }}
Expand Down Expand Up @@ -140,4 +144,4 @@ Plugins.{{ my_name }}.{{ param }}={{ value }}
{{ (zabbix_agent_runas_user is defined and zabbix_agent_runas_user is not none) | ternary('', '# ') }}User={{ zabbix_agent_runas_user | default('') }}
{% endif %}
{{ (zabbix_agent_userparamater is defined and zabbix_agent_userparamater is not none) | ternary('', '# ') }}UserParameter={{ zabbix_agent_userparamater | default('') }}
{{ (zabbix_agent_userparamaterdir is defined and zabbix_agent_userparamaterdir is not none) | ternary('', '# ') }}UserParameterDir={{ zabbix_agent_userparamaterdir | default('') }}
{{ (zabbix_agent_userparamaterdir is defined and zabbix_agent_userparamaterdir is not none) | ternary('', '# ') }}UserParameterDir={{ zabbix_agent_userparamaterdir | default (false) | ternary('1', '0') }}

0 comments on commit bd6ed0d

Please sign in to comment.