| 1 | # community.zabbix.zabbix_javagateway role |
| 2 | |
| 3 |  |
| 4 | |
| 5 | **Table of Contents** |
| 6 | |
| 7 | - [Overview](#overview) |
| 8 | * [Operating systems](#operating-systems) |
| 9 | * [Zabbix Versions](#zabbix-versions) |
| 10 | - [Role Variables](#role-variables) |
| 11 | * [Main variables](#main-variables) |
| 12 | + [Overall Zabbix](#overall-zabbix) |
| 13 | + [Java Gatewaty](#java-gatewaty) |
| 14 | + [proxy](#proxy) |
| 15 | - [Dependencies](#dependencies) |
| 16 | - [Example Playbook](#example-playbook) |
| 17 | - [Molecule](#molecule) |
| 18 | - [License](#license) |
| 19 | - [Author Information](#author-information) |
| 20 | |
| 21 | # Overview |
| 22 | |
| 23 | ## Operating systems |
| 24 | |
| 25 | This role will work on the following operating systems: |
| 26 | |
| 27 | * Red Hat |
| 28 | * Debian |
| 29 | * Ubuntu |
| 30 | |
| 31 | So, you'll need one of those operating systems.. :-) |
| 32 | |
| 33 | ## Zabbix Versions |
| 34 | |
| 35 | See the following list of supported Operating systems with the Zabbix releases. |
| 36 | |
| 37 | | Zabbix | 7.4 | 7.2 | 7.0 | 6.0 | |
| 38 | |---------------------|-----|-----|-----|-----| |
| 39 | | Red Hat Fam 9 | V | V | V | V | |
| 40 | | Red Hat Fam 8 | V | V | V | V | |
| 41 | | Ubuntu 24.04 noble | V | V | V | V | |
| 42 | | Ubuntu 22.04 jammy | V | V | V | V | |
| 43 | | Debian 12 bookworm | V | V | V | V | |
| 44 | | Debian 11 bullseye | V | V | V | V | |
| 45 | | Suse Fam 15 | V | V | V | V | |
| 46 | |
| 47 | You can bypass this matrix by setting `enable_version_check: false` |
| 48 | |
| 49 | # Role Variables |
| 50 | |
| 51 | ## Main variables |
| 52 | |
| 53 | The following is an overview of all available configuration default for this role. |
| 54 | |
| 55 | ### Overall Zabbix |
| 56 | |
| 57 | The `zabbix_javagateway_version` is optional. The latest available major.minor version of Zabbix will be installed on the host(s). If you want to use an older version, please specify this in the major.minor format. Example: `zabbix_javagateway_version: 6.0`. |
| 58 | * `zabbix_repo_yum`: A list with Yum repository configuration. |
| 59 | * `zabbix_repo_yum_schema`: Default: `https`. Option to change the web schema for the yum repository(http/https) |
| 60 | * `zabbix_javagateway_disable_repo`: A list of repos to disable during install. Default `epel`. |
| 61 | * `zabbix_javagateway_package_state`: Default: `present`. Can be overridden to `latest` to update packages when needed. |
| 62 | * `zabbix_javagateway_conf_mode`: Default: `0644`. The "mode" for the Zabbix configuration file. |
| 63 | * `zabbix_repo_deb_url`: The URL to the Zabbix repository. Default `http://repo.zabbix.com/zabbix/{{ zabbix_agent_version }}/{{ ansible_distribution.lower() }}` |
| 64 | * `zabbix_repo_deb_component`: The repository component for Debian installs. Default `main`. |
| 65 | * `zabbix_repo_deb_gpg_key_url`: The URL to download the Zabbix GPG key from. Default `http://repo.zabbix.com/zabbix-official-repo.key`. |
| 66 | * `zabbix_repo_deb_include_deb_src`: True, if deb-src should be included in the zabbix.sources entry. Default `true`. |
| 67 | * `zabbix_manage_repo`: Have the collection install and configure the Zabbix repo Default `true`. |
| 68 | |
| 69 | ### Java Gatewaty |
| 70 | |
| 71 | * `zabbix_javagateway_pidfile`: Default: `/run/zabbix/zabbix_java_gateway.pid`. The location for the pid file. |
| 72 | * `zabbix_javagateway_listenip`: Default: `0.0.0.0`. The IP address to listen on. |
| 73 | * `zabbix_javagateway_listenport`: Default: `10052`. The port on which Java Gateway is listening on. |
| 74 | * `zabbix_javagateway_startpollers`: Default: `5`. The amount of pollers to start. |
| 75 | |
| 76 | ### proxy |
| 77 | |
| 78 | When the target host does not have access to the internet, but you do have a proxy available then the following properties needs to be set to download the packages via the proxy: |
| 79 | |
| 80 | * `zabbix_http_proxy` |
| 81 | * `zabbix_https_proxy` |
| 82 | |
| 83 | # Dependencies |
| 84 | |
| 85 | The java gateway can be installed on either the zabbix-server or the zabbix-proxy machine. So one of these should be installed. You'll need to provide an parameter in your playbook for using the javagateway. |
| 86 | |
| 87 | When using the zabbix-server: |
| 88 | ```yaml |
| 89 | roles: |
| 90 | - role: community.zabbix.zabbix_server |
| 91 | zabbix_server_javagateway: 192.168.1.2 |
| 92 | ``` |
| 93 | |
| 94 | or when using the zabbix-proxy: |
| 95 | ```yaml |
| 96 | roles: |
| 97 | - role: community.zabbix.zabbix_proxy |
| 98 | zabbix_proxy_server: 192.168.1.1 |
| 99 | zabbix_proxy_javagateway: 192.168.1.2 |
| 100 | ``` |
| 101 | |
| 102 | ## Tags |
| 103 | |
| 104 | The majority of tasks within this role are tagged as follows: |
| 105 | |
| 106 | * `install`: Tasks associated with the installation of software. |
| 107 | * `dependencies`: Installation tasks related to dependencies that aren't part of the core zabbix installation. |
| 108 | * `database`: Tasks associated with the installation or configuration of the database. |
| 109 | * `api`: Tasks associated with using the Zabbix API to connect and modify the Zabbix server. |
| 110 | * `config`: Tasks associated with the configuration of Zabbix or a supporting service. |
| 111 | * `service`: Tasks associated with managing a service. |
| 112 | |
| 113 | # Example Playbook |
| 114 | |
| 115 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: |
| 116 | |
| 117 | ```yaml |
| 118 | - hosts: zabbix-server |
| 119 | sudo: yes |
| 120 | roles: |
| 121 | - role: community.zabbix.zabbix_server |
| 122 | zabbix_server_javagateway: 192.168.1.2 |
| 123 | - role: community.zabbix.zabbix_javagateway |
| 124 | ``` |
| 125 | |
| 126 | # Molecule |
| 127 | |
| 128 | This role is configured to be tested with Molecule. You can find on this page some more information regarding Molecule: |
| 129 | |
| 130 | * http://werner-dijkerman.nl/2016/07/10/testing-ansible-roles-with-molecule-testinfra-and-docker/ |
| 131 | * http://werner-dijkerman.nl/2016/07/27/extending-ansible-role-testing-with-molecule-by-adding-group_vars-dependencies-and-using-travis-ci/ |
| 132 | * http://werner-dijkerman.nl/2016/07/31/testing-ansible-roles-in-a-cluster-setup-with-docker-and-molecule/ |
| 133 | |
| 134 | With each Pull Request, Molecule will be executed via travis.ci. Pull Requests will only be merged once these tests run successfully. |
| 135 | |
| 136 | # License |
| 137 | |
| 138 | GNU General Public License v3.0 or later |
| 139 | |
| 140 | See LICENCE to see the full text. |
| 141 | |
| 142 | # Author Information |
| 143 | |
| 144 | Please send suggestion or pull requests to make this role better. Also let us know if you encounter any issues installing or using this role. |
| 145 | |
| 146 | Github: https://github.com/ansible-collections/community.zabbix |