Ansible role to install and configure the Zabbix Agent 2
Find a file
Simon Cornet 7db1dd350a Merge branch 'renovate_components-ansible-3.x' into 'main'
chore(package): update dependency components/ansible to v3

See merge request ansible/ans-zabbix-agent!3
2025-09-25 13:49:00 +02:00
.gitlab feat(ci): move linting to components 2025-06-13 11:50:23 +02:00
defaults feat: upgrade zabbix to version 7.4 2025-07-17 11:18:26 +02:00
files/zabbix/plugins.d feat: disable nvidia plugin 2025-04-16 18:03:18 +02:00
handlers feat: initial commit 2025-04-16 17:32:51 +02:00
meta feat: solve dependancy elsewhere 2025-06-06 17:15:52 +02:00
tasks feat: add when condition 2025-07-04 17:36:42 +02:00
templates fix: zabbix server directive 2025-04-25 22:03:16 +02:00
.ansible-lint fix(ci): linter compliance 2025-04-16 17:34:58 +02:00
.gitignore feat: initial commit 2025-04-16 17:32:51 +02:00
.gitlab-ci.yml chore(package): update dependency components/ansible to v3 2025-08-27 15:48:00 +00:00
.markdownlint-cli2.jsonc feat(ci): move linting to components 2025-06-13 11:54:28 +02:00
.yamllint fix(ci): set linelenght to 120 2025-05-09 11:39:41 +02:00
README.md feat: fast-forward update van scs 2025-04-17 14:59:54 +02:00
renovate.json fix(ci): use central config 2025-06-17 17:58:22 +02:00

Overview

This role the installation and configuration of the Zabbix Agent version 2.

Supported Operating Systems

Operating System Version
Debian 12
SLES 15
Ubuntu 22.04 LTS
Ubuntu 24.04 LTS

Variables

Variable Type Default Required
zabbix_agent_hostinterface string inventory_hostname No
zabbix_agent_hostname string inventory_hostname No
zabbix_agent_listen_port string 10050 No
zabbix_agent_psk_enable bool true No
zabbix_agent_psk_id string Yes*
zabbix_agent_psk string(enc) Yes*
zabbix_proxy_address string shared.proxy.monitor.itcreation.tools No
zabbix_proxy_port string 10051 No
zabbix_user_sudo bool true No
  • Only if zabbix_agent_psk_enable is set to true.

Example usage

With PSK:

zabbix_proxy_address: "proxy.monitor.localnet.internal"
zabbix_agent_psk_id: "client-psk"
zabbix_agent_psk: !vault
  $ANSIBLE_VAULT;1.1;AES256
  31633463613336373164373333633038393164383835646633303163316665303934646363383530
  ...

Without PSK:

zabbix_proxy_address: "proxy.monitor.localnet.internal"

DNS override

If DNS is complicated or permanently broken for some reason. We can override the hostname and hostinterface.
The hostname is the visible name in Zabbix.
The hostinterface is what Zabbix uses to connect to the host.

zabbix_agent_hostname: "server.example.com"
zabbix_agent_hostinterface: "192.168.10.10"

This is possible, but please only use if really required.

Tags

If you call the role without tags, it will execute all of the stages bellow.

Tags Purpose
zabbix_agent_config Only manage Zabbix Agent 2 configuration
zabbix_agent_install Only manage Zabbix Agent 2 installation
zabbix_agent_prereq Only manage Zabbix Agent 2 prerequisites