This is a planned fork suitable for use in production.
ansible-galaxy collection install libredevops.zabbix:2.3.1-a
At LibreDevOps we used the community.zabbix
collection every day to manage multiple Zabbix installations that are in production.
Sometimes we experience bugs that we can solve quickly and reliably and/or we incorporate features that we find interesting for our own and other people's use cases, which is why, like other members of the community, we share them with the upstream via PR. This will always remain this way.
However, since the upstream merge may take longer than our operations are capable of supporting, we not only use this fork to propose improvements but also to maintain our own stable early adopter version, with all those improvements incorporated from day zero.
We maintain here in summary, 2 important branches:
libredevops-master
: our stable version suitable for production use in which we have already merged features and bugfixes (own or from the community) and which have already been proposed to the upstreamcommunity.zabbix
main
: a faithful mirror of the upstreamcommunity.zabbix
(From here we start to work on each new correction or improvement)
To keep versioning simple and easy to relate to upstream, our versions always use the "number part" identical to the upstream version we started from, adding a -[a-z]
suffix (using the alphabet in incremental order each time a change is added, for example 2.3.1-a
). Take a look at our CHANGELOG to understand what has changed.
We invite you to share your improvements on upstream, but we will also be happy if you do so here.
Plugins:
Roles:
Table of Contents
This repo hosts the community.zabbix
Ansible Collection.
The collection includes a variety of Ansible content to help automate the management of resources in Zabbix.
Click on the name of a plugin or module to view that content's documentation:
- Inventory Sources:
- zabbix - Zabbix Inventory Script
- zabbix_inventory - Zabbix Ansible Inventory Plugin
- Modules:
- zabbix_action
- zabbix_authentication
- zabbix_autoregister
- zabbix_discovery_rule
- zabbix_globalmacro
- zabbix_group_info
- zabbix_group_events_info
- zabbix_group
- zabbix_host_events_info
- zabbix_host_info
- zabbix_host
- zabbix_hostmacro
- zabbix_housekeeping
- zabbix_maintenance
- zabbix_map
- zabbix_mediatype
- zabbix_proxy_info
- zabbix_proxy
- zabbix_screen
- zabbix_script
- zabbix_service
- zabbix_template_info
- zabbix_template
- zabbix_user_info
- zabbix_user
- zabbix_usergroup
- zabbix_valuemap
- Roles:
Each component in this collection requires additional dependencies. Review components you are interested in by visiting links present in the Included content section.
This is especially important for some of the Zabbix roles that require you to install additional standalone roles from Ansible Galaxy.
For the majority of modules, however, you can get away with just:
With the release of Ansible 2.10, modules have been moved into collections. With the exception of ansible.builtin modules, this means additonal collections must be installed in order to use modules such as seboolean (now ansible.posix.seboolean). The following collections are now frequently required: ansible.posix
and community.general
. Installing the collections:
ansible-galaxy collection install ansible.posix
ansible-galaxy collection install community.general
ansible-galaxy collection install ansible.netcommon
Before using the Zabbix collection, you need to install it with the Ansible Galaxy CLI:
ansible-galaxy collection install community.zabbix
You can also include it in a requirements.yml
file along with other required collections and install them via ansible-galaxy collection install -r requirements.yml
, using the format:
---
collections:
- name: community.zabbix
version: 2.3.1
- name: ansible.posix
version: 1.3.0
- name: community.general
version: 3.7.0
Make sure to read UPGRADE document before installing newer version of this collection.
Please note that these are not working examples. For documentation on how to use content included in this collection, refer to the links in the Included content section.
To use a module or role from this collection, reference them with their Fully Qualified Collection Namespace (FQCN) like so:
---
- name: Using Zabbix collection to install Zabbix Agent
hosts: localhost
roles:
- role: community.zabbix.zabbix_agent
zabbix_agent_server: zabbix.example.com
...
- name: If Zabbix WebUI runs on non-default (zabbix) path, e.g. http://<FQDN>/zabbixeu
ansible.builtin.set_fact:
ansible_zabbix_url_path: 'zabbixeu'
- name: Using Zabbix collection to manage Zabbix Server's elements with username/password
hosts: zabbix.example.com
vars:
ansible_network_os: community.zabbix.zabbix
ansible_connection: httpapi
ansible_httpapi_port: 80
ansible_httpapi_use_ssl: false # Set to true for HTTPS
ansible_httpapi_validate_certs: false # For HTTPS et to true to validate server's certificate
ansible_user: Admin
ansible_httpapi_pass: zabbix
tasks:
- name: Ensure host is monitored by Zabbix
community.zabbix.zabbix_host:
...
- name: Using Zabbix collection to manage Zabbix Server's elements with authentication key
hosts: zabbix.example.net
vars:
ansible_network_os: community.zabbix.zabbix
ansible_connection: httpapi
ansible_httpapi_port: 80
ansible_httpapi_use_ssl: false # Set to true for HTTPS
ansible_httpapi_validate_certs: false # For HTTPS set to true to validate server's certificate
ansible_zabbix_auth_key: 8ec0d52432c15c91fcafe9888500cf9a607f44091ab554dbee860f6b44fac895
tasks:
- name: Ensure host is monitored by Zabbix
community.zabbix.zabbix_host:
...
Or you include collection name community.zabbix
in the playbook's collections
element, like this:
---
- name: Using Zabbix collection
hosts: localhost
collections:
- community.zabbix
roles:
- role: zabbix_agent
zabbix_agent_server: zabbix.example.com
...
- name: Using Zabbix collection to manage Zabbix Server's elements with username/password
hosts: zabbix.example.com
vars:
ansible_network_os: community.zabbix.zabbix
ansible_connection: httpapi
ansible_httpapi_port: 80
ansible_httpapi_use_ssl: false # Set to true for HTTPS
ansible_httpapi_validate_certs: false # For HTTPS et to true to validate server's certificate
ansible_user: Admin
ansible_httpapi_pass: zabbix
tasks:
- name: Ensure host is monitored by Zabbix
zabbix.zabbix_host:
...
- name: Using Zabbix collection to manage Zabbix Server's elements with authentication key
hosts: zabbix.example.net
vars:
ansible_network_os: community.zabbix.zabbix
ansible_connection: httpapi
ansible_httpapi_port: 80
ansible_httpapi_use_ssl: false # Set to true for HTTPS
ansible_httpapi_validate_certs: false # For HTTPS et to true to validate server's certificate
ansible_zabbix_auth_key: 8ec0d52432c15c91fcafe9888500cf9a607f44091ab554dbee860f6b44fac895
tasks:
- name: Ensure host is monitored by Zabbix
community.zabbix.zabbix_host:
...
If Basic Authentication is required to access Zabbix server add following variables:
zabbix_api_http_user: "user"
zabbix_api_http_password: "password"
Main priority is to support Zabbix releases which have official full support from Zabbix LLC. Please checkout the versions at Zabbix Life Cycle & Release Policy page.
Support for Zabbix LTS versions will be dropped with Major releases of the collection and mostly affect modules. Each role is following its unique support matrix. You should always consult documentation of roles in docs/ directory.
If you find any inconsistencies with the version of Zabbix you are using, feel free to open a pull request or an issue and we will try to address it as soon as possible. In case of pull requests, please make sure that your changes will not break any existing functionality for currently supported Zabbix releases.
See RELEASE document for more information regarding life cycle and support for the collection.
See CONTRIBUTING for more information about how to contribute to this repository.
Please also feel free to stop by our Gitter community.
GNU General Public License v3.0 or later
See LICENSE to see the full text.