dj-wasabi.zabbix-proxy
Table of Content
Overview
This role has moved to: https://github.com/ansible-collections/community.zabbix/ A read-only version will be available here for users who cannot use collections yet. Future updates will only be made in the new collection repository.
Upgrades
1.0.0
In this 1.0.0 release, every property now starts with zabbix_
. For example, proxy_dbhost
is now zabbix_proxy_dbhost
.
Operating Systems
This role works on the following operating systems:
- Red Hat
- Debian
- Ubuntu
You need one of these operating systems. Please send Pull Requests or suggestions if you want to use this role with others.
Zabbix Versions
Here’s a list of supported operating systems with their corresponding Zabbix versions.
Zabbix 4.4
- CentOS 7.x, 8.x
- Amazon 7.x
- Red Hat 7.x, 8.x
- Oracle Linux 7.x, 8.x
- Scientific Linux 7.x, 8.x
- Ubuntu 14.04, 16.04, 18.04
- Debian 8, 9
Zabbix 4.2
- CentOS 7.x
- Amazon 7.x
- Red Hat 7.x
- Oracle Linux 7.x
- Scientific Linux 7.x
- Ubuntu 14.04, 16.04, 18.04
- Debian 8, 9
Zabbix 4.0
- Same as 4.2
Zabbix 3.4
- Similar to 4.2 with support for Debian 7 as well.
Zabbix 3.2
- Same list as 3.4
Zabbix 3.0
- CentOS 5.x, 6.x, 7.x
- Amazon 5.x, 6.x, 7.x
- Red Hat 5.x, 6.x, 7.x
- Oracle Linux 5.x, 6.x, 7.x
- Scientific Linux 5.x, 6.x, 7.x
- Ubuntu 14.04
- Debian 7, 8
Zabbix 2.4
- CentOS 6.x, 7.x
- Amazon 6.x, 7.x
- Red Hat 6.x, 7.x
- Oracle Linux 6.x, 7.x
- Scientific Linux 6.x, 7.x
- Ubuntu 12.04, 14.04
- Debian 7
Zabbix 2.2
- CentOS 5.x, 6.x
- Red Hat 5.x, 6.x
- Oracle Linux 5.x, 6.x
- Scientific Linux 5.x, 6.x
- Ubuntu 12.04
- Debian 7
Role Variables
Main Variables
Here are some default variables in main.yml
that you can change:
zabbix_server_host
: IP or DNS name of the Zabbix server.zabbix_server_port
: The port the Zabbix server uses (default is 10051).zabbix_version
: Version of Zabbix (default is 4.2).zabbix_proxy_{rhel,debian,ubuntu}_version
: Version of the Zabbix proxy.zabbix_repo
: True/False. Set to False if you already have a Zabbix components repository.zabbix_proxy_package_state
: Default is present. Change to "latest" to update packages.zabbix_proxy_install_database_client
: True/False. Default is True; set to False if you don’t want to install it.zabbix_agent_become_on_localhost
: Set to False if no elevated privileges are needed on localhost. Default is True.zabbix_proxy_manage_service
: True/False. If using multiple Zabbix proxies in a cluster, set to False so Ansible doesn’t manage the service.zabbix_install_pip_packages
: Set to False if you don’t want to install required Python packages. Useful if you have full control over your environment.
If using MySQL, define the following for the Zabbix database:
zabbix_proxy_mysql_login_host
zabbix_proxy_mysql_login_user
zabbix_proxy_mysql_login_password
TLS Specific Configuration
These variables apply to Zabbix 3.0 and above:
*zabbix_proxy_tlsconnect
: Connection type for the proxy to the server (e.g., no_encryption, PSK, certificate).*zabbix_proxy_tlsaccept
: What incoming connections to accept.*zabbix_proxy_tlscafile
: CA certificate file path.*zabbix_proxy_tlscrlfile
: File path with revoked certificates.*zabbix_proxy_tlsservercertissuer
: Allowed server certificate issuer.*zabbix_proxy_tlsservercertsubject
: Allowed server certificate subject.*zabbix_proxy_tlscertfile
: File path for the agent certificate.*zabbix_proxy_tlskeyfile
: File path for the agent private key.*zabbix_proxy_tlspskidentity
: Unique string for the pre-shared key.
Zabbix API Variables
These variables must be overridden to use the Zabbix API for creating or updating hosts:
zabbix_url
: The URL for the Zabbix web page (e.g., http://zabbix.example.com).zabbix_api_http_user
: HTTP user for Zabbix with Basic Auth.zabbix_api_http_password
: HTTP password for Zabbix with Basic Auth.zabbix_api_create_proxy
: Set to True to use the Zabbix API for proxy management.zabbix_api_user
: Username with API access.zabbix_api_pass
: Password for the API user.zabbix_create_proxy
: Set to present (default) to create the proxy or absent to delete it.zabbix_proxy_status
: Set to active (default) for active or passive proxy.
Dependencies
You need to find the right database role yourself. If you know one that supports the three main operating systems, please let me know.
Example Playbook
Here’s how to use the role with variable inputs:
- hosts: zabbix-proxy
sudo: yes
roles:
- { role: dj-wasabi.zabbix-proxy, zabbix_server_host: 192.168.1.1, database_type: pgsql, database_type_long: postgresql }
License
GPLv3
Author Information
This is my first attempt at creating an Ansible role. Please send suggestions or pull requests to help improve this role.
GitHub: https://github.com/dj-wasabi/ansible-zabbix-proxy
Email: ikben [ at ] werner-dijkerman . nl
Installing and maintaining zabbix-proxy for RedHat/Debian/Ubuntu.
ansible-galaxy install dj-wasabi.zabbix-proxy