From d4f8b4acb8a52522db32ae5f4550b8609f5e84d0 Mon Sep 17 00:00:00 2001 From: Dusan Matejka Date: Wed, 10 Jun 2020 13:53:35 +0200 Subject: [PATCH] reorganize role documentation files --- .../CODE_OF_CONDUCT.md => CODE_OF_CONDUCT.md | 0 .../CONTRIBUTING.md => CONTRIBUTING.md | 0 docs/ZABBIX_AGENT_ROLE.md | 604 +++++++++++++++++ docs/ZABBIX_JAVAGATEWAY_ROLE.md | 69 ++ docs/ZABBIX_PROXY_ROLE.md | 257 ++++++++ docs/ZABBIX_SERVER_ROLE.md | 320 +++++++++ docs/ZABBIX_WEB_ROLE.md | 326 ++++++++++ roles/zabbix_agent/CHANGELOG.md | 294 --------- roles/zabbix_agent/LICENSE | 21 - roles/zabbix_agent/PULL_REQUEST_TEMPLATE.md | 12 - roles/zabbix_agent/README.md | 605 +----------------- roles/zabbix_agent/setup.cfg | 2 - roles/zabbix_agent/upgrade.md | 11 - roles/zabbix_javagateway/README.md | 70 +- roles/zabbix_javagateway/setup.cfg | 2 - roles/zabbix_proxy/CHANGELOG.md | 105 --- roles/zabbix_proxy/CODE_OF_CONDUCT.md | 3 - roles/zabbix_proxy/CONTRIBUTING.md | 88 --- roles/zabbix_proxy/LICENSE | 21 - roles/zabbix_proxy/PULL_REQUEST_TEMPLATE.md | 12 - roles/zabbix_proxy/README.md | 258 +------- roles/zabbix_server/CHANGELOG.md | 177 ----- roles/zabbix_server/CODE_OF_CONDUCT.md | 3 - roles/zabbix_server/CONTRIBUTING.md | 88 --- roles/zabbix_server/LICENSE | 21 - roles/zabbix_server/PULL_REQUEST_TEMPLATE.md | 12 - roles/zabbix_server/README.md | 321 +--------- roles/zabbix_server/inventory | 9 - roles/zabbix_server/setup.cfg | 2 - roles/zabbix_web/CHANGELOG.md | 83 --- roles/zabbix_web/CODE_OF_CONDUCT.md | 3 - roles/zabbix_web/CONTRIBUTING.md | 88 --- roles/zabbix_web/LICENSE | 21 - roles/zabbix_web/PULL_REQUEST_TEMPLATE.md | 12 - roles/zabbix_web/README.md | 327 +--------- roles/zabbix_web/ansible.cfg | 3 - roles/zabbix_web/inventory | 9 - roles/zabbix_web/setup.cfg | 2 - 38 files changed, 1581 insertions(+), 2680 deletions(-) rename roles/zabbix_agent/CODE_OF_CONDUCT.md => CODE_OF_CONDUCT.md (100%) rename roles/zabbix_agent/CONTRIBUTING.md => CONTRIBUTING.md (100%) create mode 100644 docs/ZABBIX_AGENT_ROLE.md create mode 100644 docs/ZABBIX_JAVAGATEWAY_ROLE.md create mode 100644 docs/ZABBIX_PROXY_ROLE.md create mode 100644 docs/ZABBIX_SERVER_ROLE.md create mode 100644 docs/ZABBIX_WEB_ROLE.md delete mode 100644 roles/zabbix_agent/CHANGELOG.md delete mode 100644 roles/zabbix_agent/LICENSE delete mode 100644 roles/zabbix_agent/PULL_REQUEST_TEMPLATE.md mode change 100644 => 120000 roles/zabbix_agent/README.md delete mode 100644 roles/zabbix_agent/setup.cfg delete mode 100644 roles/zabbix_agent/upgrade.md mode change 100644 => 120000 roles/zabbix_javagateway/README.md delete mode 100644 roles/zabbix_javagateway/setup.cfg delete mode 100644 roles/zabbix_proxy/CHANGELOG.md delete mode 100644 roles/zabbix_proxy/CODE_OF_CONDUCT.md delete mode 100644 roles/zabbix_proxy/CONTRIBUTING.md delete mode 100644 roles/zabbix_proxy/LICENSE delete mode 100644 roles/zabbix_proxy/PULL_REQUEST_TEMPLATE.md mode change 100644 => 120000 roles/zabbix_proxy/README.md delete mode 100644 roles/zabbix_server/CHANGELOG.md delete mode 100644 roles/zabbix_server/CODE_OF_CONDUCT.md delete mode 100644 roles/zabbix_server/CONTRIBUTING.md delete mode 100644 roles/zabbix_server/LICENSE delete mode 100644 roles/zabbix_server/PULL_REQUEST_TEMPLATE.md mode change 100644 => 120000 roles/zabbix_server/README.md delete mode 100644 roles/zabbix_server/inventory delete mode 100644 roles/zabbix_server/setup.cfg delete mode 100644 roles/zabbix_web/CHANGELOG.md delete mode 100644 roles/zabbix_web/CODE_OF_CONDUCT.md delete mode 100644 roles/zabbix_web/CONTRIBUTING.md delete mode 100644 roles/zabbix_web/LICENSE delete mode 100644 roles/zabbix_web/PULL_REQUEST_TEMPLATE.md mode change 100644 => 120000 roles/zabbix_web/README.md delete mode 100644 roles/zabbix_web/ansible.cfg delete mode 100644 roles/zabbix_web/inventory delete mode 100644 roles/zabbix_web/setup.cfg diff --git a/roles/zabbix_agent/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md similarity index 100% rename from roles/zabbix_agent/CODE_OF_CONDUCT.md rename to CODE_OF_CONDUCT.md diff --git a/roles/zabbix_agent/CONTRIBUTING.md b/CONTRIBUTING.md similarity index 100% rename from roles/zabbix_agent/CONTRIBUTING.md rename to CONTRIBUTING.md diff --git a/docs/ZABBIX_AGENT_ROLE.md b/docs/ZABBIX_AGENT_ROLE.md new file mode 100644 index 000000000..742cea4db --- /dev/null +++ b/docs/ZABBIX_AGENT_ROLE.md @@ -0,0 +1,604 @@ +Table of Contents + +- [Overview](#overview) +- [Requirements](#requirements) + * [Operating systems](#operating-systems) + * [Local system access](#local-system-access) + * [Zabbix Versions](#zabbix-versions) + + [Zabbix 4.4](#zabbix-44) + + [Zabbix 4.2](#zabbix-42) + + [Zabbix 4.0](#zabbix-40) + + [Zabbix 3.4](#zabbix-34) + + [Zabbix 3.2](#zabbix-32) + + [Zabbix 3.0](#zabbix-30) + + [Zabbix 2.4](#zabbix-24) + + [Zabbix 2.2](#zabbix-22) +- [Getting started](#getting-started) + * [Installation](#installation) + * [Minimal Configuration](#minimal-configuration) + * [Issues](#issues) +- [Role Variables](#role-variables) + * [Main variables](#main-variables) + * [TLS Specific configuration](#tls-specific-configuration) + * [Zabbix API variables](#zabbix-api-variables) + * [Windows Variables](#windows-variables) + * [Docker Variables](#docker-variables) + * [Other variables](#other-variables) + * [proxy](#proxy) +- [Dependencies](#dependencies) +- [Example Playbook](#example-playbook) + * [agent_interfaces](#agent-interfaces) + * [Other interfaces](#other-interfaces) + * [Vars in role configuration](#vars-in-role-configuration) + * [Combination of group_vars and playbook](#combination-of-group-vars-and-playbook) + * [Example for TLS PSK encrypted agent communication](#example-for-tls-psk-encrypted-agent-communication) +- [Molecule](#molecule) + * [default](#default) + * [with-server](#with-server) + * [before-last-version](#before-last-version) +- [Deploying Userparameters](#deploying-userparameters) +- [License](#license) +- [Author Information](#author-information) + +# Introduction + +This role is migrated to: https://github.com/ansible-collections/community.zabbix/ +In this repository, a read only version is/will be available for those who can not make use of collections (yet). Changes/updates will only be applied to the collection and not in this repository. + +# Requirements +## Operating systems +This role will work on the following operating systems: + + * Red Hat + * Fedora + * Debian + * Ubuntu + * opensuse + * Windows (Best effort) + * macOS + +So, you'll need one of those operating systems.. :-) +Please sent Pull Requests or suggestions when you want to use this role for other Operating systems. + +## Local system access + +To successfully complete the install the role requires `python-netaddr` on the controller to be able to manage IP addresses. This requires that the library is available on your local machine (or that `pip` is installed to be able to run). This will likely mean that running the role will require `sudo` access to your local machine and therefore you may need the `-K` flag to be able to enter your local machine password if you are not running under root. + +## Zabbix Versions + +See the following list of supported Operating systems with the Zabbix releases: + +### Zabbix 4.4 + + * CentOS 7.x, 8.x + * Amazon 7.x + * RedHat 7.x, 8.x + * Fedora 27, 29 + * OracleLinux 7.x, 8.x + * Scientific Linux 7.x, 8.x + * Ubuntu 14.04, 16.04, 18.04 + * Debian 8, 9, 10 + * macOS 10.14, 10.15 + +### Zabbix 4.2 + + * CentOS 7.x + * Amazon 7.x + * RedHat 7.x + * Fedora 27, 29 + * OracleLinux 7.x + * Scientific Linux 7.x + * Ubuntu 14.04, 16.04, 18.04 + * Debian 8, 9, 10 + * macOS 10.14, 10.15 + +### Zabbix 4.0 + + * CentOS 7.x + * Amazon 7.x + * RedHat 7.x + * Fedora 27, 29 + * OracleLinux 7.x + * Scientific Linux 7.x + * Ubuntu 14.04, 16.04, 18.04 + * Debian 8, 9, 10 + * macOS 10.14, 10.15 + +### Zabbix 3.4 + + * CentOS 7.x + * Amazon 7.x + * RedHat 7.x + * Fedora 27, 29 + * OracleLinux 7.x + * Scientific Linux 7.x + * Ubuntu 14.04, 16.04, 18.04 + * Debian 7, 8, 9 + +### Zabbix 3.2 + + * CentOS 7.x + * Amazon 7.x + * RedHat 7.x + * Fedora 27, 29 + * OracleLinux 7.x + * Scientific Linux 7.x + * Ubuntu 14.04, 16.04 + * Debian 7, 8 + +### Zabbix 3.0 + + * CentOS 5.x, 6.x, 7.x + * Amazon 5.x, 6.x, 7.x + * RedHat 5.x, 6.x, 7.x + * OracleLinux 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 + * RedHat 6.x, 7.x + * OracleLinux 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 + * RedHat 5.x, 6.x + * OracleLinux 5.x, 6.x + * Scientific Linux 5.x, 6.x + * Ubuntu 12.04 + * Debian 7 + * xenserver 6 + +# Getting started + +## Installation + +Installing this role is very simple: `ansible-galaxy install dj-wasabi.zabbix-agent` + +This will install the zabbix-agent role into your `roles` directory. + +## Minimal Configuration + +In order to get the Zabbix Agent running, you'll have to define the following properties before executing the role: + +* zabbix_agent_version +* zabbix_agent_server +* zabbix_agent_serveractive (When using active checks) + +The `zabbix_agent_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_agent_version: 4.0`, `zabbix_agent_version: 3.4` or `zabbix_agent_version: 2.2`. + +The `zabbix_agent_server` (and `zabbix_agent_serveractive`) should contain the ip or fqdn of the host running the Zabbix Server. + +## Issues + +Due to issue discussed on [#291](https://github.com/dj-wasabi/ansible-zabbix-agent/issues/291), the Ansible Version 2.9.{0,1,2} isn't working correctly on Windows related targets. + +# Role Variables + +## Main variables + +There are some variables in default/main.yml which can (or need to) be overridden: + +* `zabbix_agent_server`: The ip address for the zabbix-server or zabbix-proxy. + +* `zabbix_agent_serveractive`: The ip address for the zabbix-server or zabbix-proxy for active checks. + +* `zabbix_agent_version`: This is the version of zabbix. Default it is 4.4, but can be overridden to one of the versions mentioned in [Zabbix Versions](#zabbix-versions). Previously the variable `zabbix_version` was used directly but it could cause [some inconvenience](https://github.com/dj-wasabi/ansible-zabbix-agent/pull/303). That variable is maintained by retrocompativility. + +* `zabbix_repo`: Default: _zabbix_ + * _epel_ install agent from EPEL repo + * _zabbix_ (default) install agent from Zabbix repo + * _other_ install agent from pre-existing or other repo + +* `zabbix_agent_listeninterface`: Interface zabbix-agent listens on. Leave blank for all. + +* `zabbix_agent_package`: The name of the zabbix-agent package. Default: `zabbix-agent`. In case for EPEL, it is automatically renamed. + +* `zabbix_sender_package`: The name of the zabbix-sender package. Default: `zabbix-sender`. In case for EPEL, it is automatically renamed. + +* `zabbix_get_package`: The name of the zabbix-get package. Default: `zabbix-get`. In case for EPEL, it is automatically renamed. + +* `zabbix_agent_package_state`: If Zabbix-agent needs to be present or latest. + +* `zabbix_agent_interfaces`: A list that configured the interfaces you can use when configuring via API. + +* `zabbix_selinux`: Enables an SELinux policy so that the agent will run. Default: False. + +* `zabbix_agent_userparameters`: List of userparameter names and scripts (if any). Detailed description is given in the [Deploying Userparameters](#deploying-userparameters) section. Default: `[]` (Empty list). + * `name`: Userparameter name (should be the same with userparameter template file name) + * `scripts_dir`: Directory name of the custom scripts needed for userparameters + +* `zabbix_agent_userparameters_templates_src`: indicates the relative path (from `templates/`) where userparameter templates are searched + +* `zabbix_agent_userparameters_scripts_src`: indicates the relative path (from `files/`) where userparameter scripts are searched + +* `zabbix_agent_allowroot`: Allow the agent to run as 'root'. 0 - do not allow, 1 - allow + +* `zabbix_agent_runas_user`: Drop privileges to a specific, existing user on the system. Only has effect if run as 'root' and AllowRoot is disabled. + +* `zabbix_agent_become_on_localhost`: Set to `False` if you don't need to elevate privileges on localhost to install packages locally with pip. Default: True + +* `zabbix_install_pip_packages`: Set to `False` if you don't want to install the required pip packages. Useful when you control your environment completely. Default: True + +* `zabbix_agent_apt_priority`: Add a weight (`Pin-Priority`) for the APT repository. + +## TLS Specific configuration + +These variables are specific for Zabbix 3.0 and higher: + +* `zabbix_agent_tlsconnect`: How the agent should connect to server or proxy. Used for active checks. + + Possible values: + + * unencrypted + * psk + * cert + +* `zabbix_agent_tlsaccept`: What incoming connections to accept. + + Possible values: + + * unencrypted + * psk + * cert + +* `zabbix_agent_tlscafile`: Full pathname of a file containing the top-level CA(s) certificates for peer certificate verification. + +* `zabbix_agent_tlscrlfile`: Full pathname of a file containing revoked certificates. + +* `zabbix_agent_tlsservercertissuer`: Allowed server certificate issuer. + +* `zabbix_agent_tlsservercertsubject`: Allowed server certificate subject. + +* `zabbix_agent_tlscertfile`: Full pathname of a file containing the agent certificate or certificate chain. + +* `zabbix_agent_tlskeyfile`: Full pathname of a file containing the agent private key. + +* `zabbix_agent_tlspskidentity`: Unique, case sensitive string used to identify the pre-shared key. + +* `zabbix_agent_tlspskidentity_file`: Full pathname of a file containing the pre-shared key identity. + +* `zabbix_agent_tlspskfile`: Full pathname of a file containing the pre-shared key. + +* `zabbix_agent_tlspsk_secret`: The pre-shared secret key that should be placed in the file configured with `agent_tlspskfile`. + +* `zabbix_agent_tlspsk_auto`: Enables auto generation and storing of individual pre-shared keys and identities on clients. + +## Zabbix API variables + +These variables need to be overridden when you want to make use of the zabbix-api for automatically creating and or updating hosts. + +Host encryption configuration will be set to match agent configuration. + +When `zabbix_api_create_hostgroup` or `zabbix_api_create_hosts` is set to `True`, it will install on the host executing the Ansible playbook the `zabbix-api` python module. + +* `zabbix_url`: The url on which the Zabbix webpage is available. Example: http://zabbix.example.com + +* `zabbix_api_http_user`: The http user to access zabbix url with Basic Auth +* `zabbix_api_http_password`: The http password to access zabbix url with Basic Auth + +* `zabbix_api_create_hosts`: When you want to enable the Zabbix API to create/delete the host. This has to be set to `True` if you want to make use of `zabbix_create_host`. Default: `False` + +* `zabbix_api_create_hostgroup`: When you want to enable the Zabbix API to create/delete the hostgroups. This has to be set to `True` if you want to make use of `zabbix_create_hostgroup`.Default: `False` + +* `zabbix_api_user`: Username of user which has API access. + +* `zabbix_api_pass`: Password for the user which has API access. + +* `zabbix_create_hostgroup`: present (Default) if the hostgroup needs to be created or absent if you want to delete it. This only works when `zabbix_api_create_hostgroup` is set to `True`. + +* `zabbix_host_status`: enabled (Default) when host in monitored, disabled when host is disabled for monitoring. + +* `zabbix_create_host`: present (Default) if the host needs to be created or absent is you want to delete it. This only works when `zabbix_api_create_hosts` is set to `True`. + +* `zabbix_update_host`: yes (Default) if the host should be updated if already present. This only works when `zabbix_api_create_hosts` is set to `True`. + +* `zabbix_useuip`: 1 if connection to zabbix-agent is made via ip, 0 for fqdn. + +* `zabbix_host_groups`: A list of hostgroups which this host belongs to. + +* `zabbix_link_templates`: A list of templates which needs to be link to this host. The templates should exist. + +* `zabbix_macros`: A list with macro_key and macro_value for creating hostmacro's. + +* `zabbix_inventory_mode`: Configure Zabbix inventory mode. Needed for building inventory data, manually when configuring a host or automatically by using some automatic population options. This has to be set to `automatic` if you want to make automatically building inventory data. + +* `zabbix_visible_hostname` : Configure Zabbix visible name inside Zabbix web UI for the node. + +* `zabbix_validate_certs` : yes (Default) if we need to validate tls certificates of the API. Use `no` in case self-signed certificates are used + +## Windows Variables + +**NOTE** + +_Supporting Windows is a best effort (I don't have the possibility to either test/verify changes on the various amount of available Windows instances). PRs specific to Windows will almost immediately be merged, unless someone is able to provide a Windows test mechanism via Travis for Pull Requests._ + +* `zabbix_version_long`: The long (major.minor.patch) version of the Zabbix Agent. This will be used to generate the `zabbix_win_download_link` link and for Zabbix Agent update if `zabbix_agent_package_state: latest`. + +* `zabbix_win_download_link`: The download url to the `win.zip` file. + +* `zabbix_win_install_dir`: The directory where Zabbix needs to be installed. + +* `zabbix_agent_win_logfile`: The full path to the logfile for the Zabbix Agent. + +* `zabbix_agent_win_include`: The directory in which the Zabbix specific configuration files are stored. + +* `zabbix_agent_win_svc_recovery`: Enable Zabbix Agent service auto-recovery settings. + +## macOS Variables + +* `zabbix_version_long`: The long (major.minor.patch) version of the Zabbix Agent. This will be used to generate the `zabbix_mac_download_link` link. + +* `zabbix_mac_download_link`: The download url to the `pkg` file. + +## Docker Variables + +When you don't want to install the Zabbix Agent on the host, but would like to run it in a container then these properties are useful. When `zabbix_agent_docker` is set to `True`, then a +Docker image will be downloaded and a Container will be started. No other installations will be done on the host, with the exception of the PSK file and the "Zabbix Include Directory". + +The following directories are mounted in the Container: + +``` + - /etc/zabbix/zabbix_agentd.d:/etc/zabbix/zabbix_agentd.d + - /:/hostfs:ro + - /etc:/hostfs/etc:ro + - /proc:/hostfs/proc:ro + - /sys:/hostfs/sys:ro + - /var/run:/var/run +``` + +Keep in mind that using the Zabbix Agent in a Container requires changes to the Zabbix Template for Linux as `/proc`, `/sys` and `/etc` are mounted in a directory `/hostfs`. + +* `zabbix_agent_docker`: When set to `True`, it will install a Docker container on the target host instead of installation on the target. Default: `False` + +* `zabbix_agent_docker_state`: Default: `started` + +* `zabbix_agent_docker_name`: The name of the Container. Default: `zabbix-agent` + +* `zabbix_agent_docker_image`: The name of the Docker image. Default: `zabbix/zabbix-agent` + +* `zabbix_agent_docker_image_tag`: The tag of the Docker image. + +* `zabbix_agent_docker_user_gid`: The group id of the zabbix user in the Container. + +* `zabbix_agent_docker_user_uid`: The user id of the zabbix user in the Container. + +* `zabbix_agent_docker_network_mode`: The name of the (Docker) network that should be used for the Container. Default `host`. + +* `zabbix_agent_docker_restart_policy`: The restart policy of the Container. Default: `unless-stopped` + +* `zabbix_agent_docker_privileged`: When set to `True`, the container is running in privileged mode. + +* `zabbix_agent_docker_ports`: A list with `:` values to open ports to the container. + +* `zabbix_agent_docker_security_opts`: A list with available security options. + +* `zabbix_agent_docker_volumes`: A list with all directories that needs to be available in the Container. + +* `zabbix_agent_docker_env`: A dict with all environment variables that needs to be set for the Container. + +## Other variables + +* `zabbix_agent_firewall_enable`: If IPtables needs to be updated by opening an TCP port for port configured in `zabbix_agent_listenport`. + +* `zabbix_agent_firewall_source`: When provided, IPtables will be configuring to only allow traffic from this IP address/range. + +* `zabbix_agent_firewalld_enable`: If firewalld needs to be updated by opening an TCP port for port configured in `zabbix_agent_listenport` and `zabbix_agent_jmx_listenport` if defined. + +* `zabbix_agent_firewalld_source`: When provided, firewalld will be configuring to only allow traffic for IP configured in `zabbix_agent_server`. + +* `zabbix_agent_firewalld_zone`: When provided, the firewalld rule will be attached to this zone (only if zabbix_agent_firewalld_enable is set to true). The default behavior is to use the default zone define by the remote host firewalld configuration. + +* `zabbix_agent_firewall_action`: When to `insert` the rule or to `append` to IPTables. Default: `insert`. + +* `zabbix_agent_firewall_chain`: Which `chain` to add the rule to IPTables. Default `INPUT` + +* `zabbix_agent_description`: Description of the host in Zabbix. + +* `zabbix_agent_inventory_zabbix`: Adds Facts for a zabbix inventory + +## IPMI variables + +* `zabbix_agent_ipmi_authtype`: IPMI authentication algorithm. Possible values are 1 (callback), 2 (user), 3 (operator), 4 (admin), 5 (OEM), with 2 being the API default. + +* `zabbix_agent_ipmi_password`: IPMI password. + +* `zabbix_agent_ipmi_privilege`: IPMI privilege level. Possible values are 1 (callback), 2 (user), 3 (operator), 4 (admin), 5 (OEM), with 2 being the API default. + +* `zabbix_agent_ipmi_username`: IPMI username. + +## proxy + +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: + +* `zabbix_http_proxy` +* `zabbix_https_proxy` + +# Dependencies + +There are no dependencies on other roles. + +# Example Playbook + +## agent_interfaces + +This will configure the Zabbix Agent interface on the host. +``` +zabbix_agent_interfaces: + - type: 1 + main: 1 + useip: "{{ zabbix_useuip }}" + ip: "{{ zabbix_agent_ip }}" + dns: "{{ ansible_fqdn }}" + port: "{{ zabbix_agent_listenport }}" +``` + +## Other interfaces + +You can also configure the `zabbix_agent_interfaces` to add/configure snmp, jmx and ipmi interfaces. + +You'll have to use one of the following type numbers when configuring it: + +| Type Interface | Nr | +|-----------------|-------| +| Zabbix Agent | 1 | +| snmp | 2 | +| ipmi | 3 | +| jmx | 4 | + +Configuring a snmp interface will look like this: + +``` +zabbix_agent_interfaces: + - type: 2 + main: 1 + useip: "{{ zabbix_useuip }}" + ip: "{{ agent_ip }}" + dns: "{{ ansible_fqdn }}" + port: "{{ agent_listenport }}" +``` + +## Vars in role configuration +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: all + roles: + - role: dj-wasabi.zabbix-agent + zabbix_agent_server: 192.168.33.30 + zabbix_agent_serveractive: 192.168.33.30 + zabbix_url: http://zabbix.example.com + zabbix_api_use: true # use zabbix_api_create_hosts and/or zabbix_api_create_hostgroup from 0.8.0 + zabbix_api_user: Admin + zabbix_api_pass: zabbix + zabbix_create_host: present + zabbix_host_groups: + - Linux Servers + zabbix_link_templates: + - Template OS Linux + - Apache APP Template + zabbix_macros: + - macro_key: apache_type + macro_value: reverse_proxy + +## Combination of group_vars and playbook +You can also use the group_vars or the host_vars files for setting the variables needed for this role. File you should change: `group_vars/all` or `host_vars/` (Where is the hostname of the machine running Zabbix Server) + + zabbix_agent_server: 192.168.33.30 + zabbix_agent_serveractive: 192.168.33.30 + zabbix_url: http://zabbix.example.com + zabbix_api_use: true # use zabbix_api_create_hosts and/or zabbix_api_create_hostgroup from 0.8.0 + zabbix_api_user: Admin + zabbix_api_pass: zabbix + zabbix_create_host: present + zabbix_host_groups: + - Linux Servers + zabbix_link_templates: + - Template OS Linux + - Apache APP Template + zabbix_macros: + - macro_key: apache_type + macro_value: reverse_proxy + +and in the playbook only specifying: + + - hosts: all + roles: + - role: dj-wasabi.zabbix-agent + +## Example for TLS PSK encrypted agent communication + +Variables e.g. in the playbook or in `host_vars/myhost`: + + zabbix_agent_tlsaccept: psk + zabbix_agent_tlsconnect: psk + zabbix_agent_tlspskidentity: "myhost PSK" + zabbix_agent_tlspsk_secret: b7e3d380b9d400676d47198ecf3592ccd4795a59668aa2ade29f0003abbbd40d + zabbix_agent_tlspskfile: /etc/zabbix/zabbix_agent_pskfile.psk + +# Molecule + +This role is configured to be tested with Molecule. You can find on this page some more information regarding Molecule: https://werner-dijkerman.nl/2016/07/10/testing-ansible-roles-with-molecule-testinfra-and-docker/ + +With each Pull Request, Molecule will be executed via travis.ci. Pull Requests will only be merged once these tests run successfully. + +There are 2 scenarios that are executed with Travis. + +## default + +With the first scenario, Molecule will boot 5 Docker containers with the following OS'es: + +* Debian 8 +* CentOS 7 +* Ubuntu 16.04 +* Ubuntu 18.04 +* Mint + +This scenario will be doing a basic installation/configuration, without registering the host via the Zabbix API to the server. + +## with-server + +The 2nd scenario will boot 4 Docker containers with the following OS'es: + +* CentOS 7 (Zabbix Server) +* Debian 8 +* CentOS 7 +* Ubuntu 18.04 + +First, a Zabbix Server will be installed on a container. This installation make uses of other dj-wasabi roles to install/configure a Zabbix Server. Once this instance is running, the 3 other agents are installed. + +Each host will register itself on the Zabbix Server and the status should be 0 (This means the Zabbix Server and Zabbix Agent are connected). + +The Ubuntu agent will register itself via a PSK, so that communication between the Zabbix Server and Zabbix Agent is encrypted with e Pre-Shared Key. + +## before-last-version + +The 3rd and last scenario is the `before-last-version`. This is the same scenario like the `default`, but uses the previous Zabbix version. + +# Deploying Userparameters + +The following steps are required to install custom userparameters and/or scripts: + +* Put the desired userparameter file in the `templates/userparameters` directory and name it as `.j2`. For example: `templates/userparameters/mysql.j2`. You can change the default directory to a custom one modifying `zabbix_agent_userparameters_templates_src` variable. +* Put the scripts directory (if any) in the `files/scripts` directory. For example: `files/scripts/mysql`. You can change the default directory to a custom one modifying `zabbix_agent_userparameters_scripts_src` variable. +* Add `zabbix_agent_userparameters` variable to the playbook as a list of dictionaries and define userparameter name and scripts directory name (if there are no scripts just no not specify the `scripts_dir` variable). + +Example: + +``` +- hosts: mysql_servers + tasks: + - include_role: + name: dj-wasabi.zabbix-agent + vars: + zabbix_agent_server: zabbix.mydomain.com + zabbix_agent_userparameters: + - name: mysql + scripts_dir: mysql + - name: galera + +``` + +Example of the "templates/userparameters/mysql.j2" file: + +``` +UserParameter=mysql.ping_to,mysqladmin -uroot ping | grep -c alive +``` + +# License + +MIT + +# Author Information + +Please send suggestion or pull requests to make this role better. Also let me know if you encounter any issues installing or using this role. + +Github: https://github.com/dj-wasabi/ansible-zabbix-agent + +mail: ikben [ at ] werner-dijkerman . nl diff --git a/docs/ZABBIX_JAVAGATEWAY_ROLE.md b/docs/ZABBIX_JAVAGATEWAY_ROLE.md new file mode 100644 index 000000000..34714da9b --- /dev/null +++ b/docs/ZABBIX_JAVAGATEWAY_ROLE.md @@ -0,0 +1,69 @@ +dj-wasabi.zabbix-javagateway +========= + +This role is migrated to: https://github.com/ansible-collections/community.zabbix/ +In this repository, a read only version is/will be available for those who can not make use of collections (yet). Changes/updates will only be applied to the collection and not in this repository. + +Requirements +------------ + +This role will work on: + +* Red Hat +* Debian +* Ubuntu + +So, you'll need one of those operating systems.. :-) + +Role Variables +-------------- + +There are some variables in de default/main.yml which can (Or needs to) be changed/overriden: + +* `zabbix_version`: This is the version of zabbix. Default it is 2.4, but can be overriden to 2.2 or 2.0. + +* `zabbix_repo`: True / False. When you already have an repository with the zabbix components, you can set it to False. + +Dependencies +------------ + +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. + +When using the zabbix-server: +``` + roles: + - { role: dj-wasabi.zabbix-server, zabbix_server_javagateway: 192.168.1.2} +``` + +or when using the zabbix-proxy: +``` + roles: + - { role: dj-wasabi.zabbix-proxy, zabbix_server_host: 192.168.1.1, zabbix_proxy_javagateway: 192.168.1.2} +``` + +The above is assumed you'll using the 'dj-wasabi' zabbix roles. Don't know how to do this with other zabbix-server (or zabbix-proxy) roles from other members. + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: zabbix-server + sudo: yes + roles: + - { role: dj-wasabi.zabbix-server, zabbix_server_javagateway: 192.168.1.2} + - { role: dj-wasabi.zabbix-javagateway } + +License +------- + +GPLv3 + +Author Information +------------------ + +This is my first attempt to create an ansible role, so please send suggestion or pull requests to make this role better. + +Github: https://github.com/dj-wasabi/ansible-zabbix-proxy + +mail: ikben [ at ] werner-dijkerman . nl diff --git a/docs/ZABBIX_PROXY_ROLE.md b/docs/ZABBIX_PROXY_ROLE.md new file mode 100644 index 000000000..5b9561573 --- /dev/null +++ b/docs/ZABBIX_PROXY_ROLE.md @@ -0,0 +1,257 @@ +Table of Content + +- [Overview](#overview) +- [Upgrades](#upgrades) + * [1.0.0](#100) + * [Operating systems](#operating-systems) + * [Zabbix Versions](#zabbix-versions) + + [Zabbix 4.2](#zabbix-42) + + [Zabbix 4.0](#zabbix-40) + + [Zabbix 3.4](#zabbix-34) + + [Zabbix 3.2](#zabbix-32) + + [Zabbix 3.0](#zabbix-30) + + [Zabbix 2.4](#zabbix-24) + + [Zabbix 2.2](#zabbix-22) +- [Role Variables](#role-variables) +- [Dependencies](#dependencies) +- [Example Playbook](#example-playbook) +- [License](#license) +- [Author Information](#author-information) + + +[![Build Status](https://travis-ci.org/dj-wasabi/ansible-zabbix-proxy.svg?branch=master)](https://travis-ci.org/dj-wasabi/ansible-zabbix-proxy) + +# Overview + +This role is migrated to: https://github.com/ansible-collections/community.zabbix/ +In this repository, a read only version is/will be available for those who can not make use of collections (yet). Changes/updates will only be applied to the collection and not in this repository. + +# Upgrades + +## 1.0.0 + +With this 1.0.0 release, the following is changed: + +* All properties starts with `zabbix_` now. Example, property named `proxy_dbhost` is now `zabbix_proxy_dbhost`. + +## Operating systems + +This role will work on the following operating systems: + + * Red Hat + * Debian + * Ubuntu + +So, you'll need one of those operating systems.. :-) +Please sent Pull Requests or suggestions when you want to use this role for other Operating systems. + +## Zabbix Versions + +See the following list of supported Operating systems with the Zabbix releases. + +### Zabbix 4.4 + + * CentOS 7.x, 8.x + * Amazon 7.x + * RedHat 7.x, 8.x + * OracleLinux 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 + * RedHat 7.x + * OracleLinux 7.x + * Scientific Linux 7.x + * Ubuntu 14.04, 16.04, 18.04 + * Debian 8, 9 + +### Zabbix 4.0 + + * CentOS 7.x + * Amazon 7.x + * RedHat 7.x + * OracleLinux 7.x + * Scientific Linux 7.x + * Ubuntu 14.04, 16.04, 18.04 + * Debian 8, 9 + +### Zabbix 3.4 + + * CentOS 7.x + * Amazon 7.x + * RedHat 7.x + * OracleLinux 7.x + * Scientific Linux 7.x + * Ubuntu 14.04, 16.04 + * Debian 7, 8, 9 + +### Zabbix 3.2 + + * CentOS 7.x + * Amazon 7.x + * RedHat 7.x + * OracleLinux 7.x + * Scientific Linux 7.x + * Ubuntu 14.04, 16.04 + * Debian 7, 8 + +### Zabbix 3.0 + + * CentOS 5.x, 6.x, 7.x + * Amazon 5.x, 6.x, 7.x + * RedHat 5.x, 6.x, 7.x + * OracleLinux 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 + * RedHat 6.x, 7.x + * OracleLinux 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 + * RedHat 5.x, 6.x + * OracleLinux 5.x, 6.x + * Scientific Linux 5.x, 6.x + * Ubuntu 12.04 + * Debian 7 + +# Role Variables + +## Main variables + +There are some variables in de default/main.yml which can (Or needs to) be changed/overriden: + +* `zabbix_server_host`: The ip or dns name for the zabbix-server machine. + +* `zabbix_server_port`: The port on which the zabbix-server is running. Default: 10051 + +* `zabbix_version`: This is the version of zabbix. Default it is 4.2, but can be overriden to 4.0/3.4/3.2/3.0/2.4/2.2. + +* `zabbix_proxy_{rhel,debian,ubuntu}_version`: This is the version of zabbix proxy. For example 4.4.4/4.2.5/4.2.8 + +* `zabbix_repo`: True / False. When you already have an repository with the zabbix components, you can set it to False. + +* `*zabbix_proxy_package_state`: Default: _present_. Can be overridden to "latest" to update packages when needed. + +* `zabbix_proxy_install_database_client`: True / False. False does not install database client. Default: True. + +* `zabbix_agent_become_on_localhost`: Set to `False` if you don't need to elevate privileges on localhost to install packages locally with pip. Default: True + +* `zabbix_proxy_manage_service`: True / False. When you run multiple Zabbix proxies in a High Available cluster setup (e.g. pacemaker), you don't want Ansible to manage the zabbix-proxy service, because Pacemaker is in control of zabbix-proxy service. + +* `zabbix_install_pip_packages`: Set to `False` if you don't want to install the required pip packages. Useful when you control your environment completely. Default: True + +There are some zabbix-proxy specific variables which will be used for the zabbix-proxy configuration file, these can be found in the default/main.yml file. There are 2 which needs some explanation: + +```bash + #zabbix_proxy_database: mysql + #zabbix_proxy_database_long: mysql + #zabbix_proxy_database: sqlite3 + #zabbix_proxy_database_long: sqlite3 + zabbix_proxy_database: pgsql + zabbix_proxy_database_long: postgresql +``` + +There are 3 database_types which will be supported: mysql/postgresql and sqlite. You'll need to comment or uncomment the database you would like to use. In example from above, the postgresql database is used. If you want to use mysql, uncomment the 2 lines from mysql and comment the 2 lines for postgresql. + +If you use mysql, then you should define mysql username, password and host to prepare zabbix database, otherwise they will be considered as their default value (and therefor, connecting to database will be considered as connecting to localhost with no password). the keys are belows: + zabbix_proxy_mysql_login_host + zabbix_proxy_mysql_login_user + zabbix_proxy_mysql_login_password + +## TLS Specific configuration + +These variables are specific for Zabbix 3.0 and higher: + +* `*zabbix_proxy_tlsconnect`: How the proxy should connect to server or proxy. Used for active checks. + + Possible values: + + * no_encryption + * PSK + * certificate + +* `*zabbix_proxy_tlsaccept`: What incoming connections to accept. + + Possible values: + + * no_encryption + * PSK + * certificate + +* `*zabbix_proxy_tlscafile`: Full pathname of a file containing the top-level CA(s) certificates for peer certificate verification. + +* `*zabbix_proxy_tlscrlfile`: Full pathname of a file containing revoked certificates. + +* `*zabbix_proxy_tlsservercertissuer`: Allowed server certificate issuer. + +* `*zabbix_proxy_tlsservercertsubject`: Allowed server certificate subject. + +* `*zabbix_proxy_tlscertfile`: Full pathname of a file containing the agent certificate or certificate chain. + +* `*zabbix_proxy_tlskeyfile`: Full pathname of a file containing the agent private key. + +* `*zabbix_proxy_tlspskidentity`: Unique, case sensitive string used to identify the pre-shared key. + +## Zabbix API variables + +These variables need to be overridden when you want to make use of the zabbix-api for automatically creating and or updating hosts. + +Host encryption configuration will be set to match agent configuration. + +When `zabbix_api_create_proxy` is set to `True`, it will install on the host executing the Ansible playbook the `zabbix-api` python module. + +* `zabbix_url`: The url on which the Zabbix webpage is available. Example: http://zabbix.example.com + +* `zabbix_api_http_user`: The http user to access zabbix url with Basic Auth +* `zabbix_api_http_password`: The http password to access zabbix url with Basic Auth + +* `zabbix_api_create_proxy`: When you want to enable the Zabbix API to create/delete the proxy. This has to be set to `True` if you want to make use of `zabbix_create_proxy`. Default: `False` + +* `zabbix_api_user`: Username of user which has API access. + +* `zabbix_api_pass`: Password for the user which has API access. + +* `zabbix_create_proxy`: present (Default) if the proxy needs to be created or absent if you want to delete it. This only works when `zabbix_api_create_proxy` is set to `True`. + +* `zabbix_proxy_status`: active (Default) if the proxy needs to be active or passive. + +# Dependencies + +```text +You'll need to find the correct database role by yourself. I only want to use roles which supports the 3 main operating systems as well and for now I can't find one. If there is an role which supports these 3 operating systems, please let me know and I'll use it as dependency. +``` + +# Example Playbook + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - 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 to create an ansible role, so please send suggestion or pull requests to make this role better. + +Github: https://github.com/dj-wasabi/ansible-zabbix-proxy + +mail: ikben [ at ] werner-dijkerman . nl diff --git a/docs/ZABBIX_SERVER_ROLE.md b/docs/ZABBIX_SERVER_ROLE.md new file mode 100644 index 000000000..8daf1cb6f --- /dev/null +++ b/docs/ZABBIX_SERVER_ROLE.md @@ -0,0 +1,320 @@ +Table of Contents + +- [Overview](#overview) +- [Upgrades](#upgrades) + * [1.0.0](#100) +- [Requirements](#requirements) + * [Operating systems](#operating-systems) + * [Zabbix Versions](#zabbix-versions) + + [Zabbix 4.4](#zabbix-44) + + [Zabbix 4.2](#zabbix-42) + + [Zabbix 4.0](#zabbix-40) + + [Zabbix 3.4](#zabbix-34) + + [Zabbix 3.2](#zabbix-32) + + [Zabbix 3.0](#zabbix-30) + + [Zabbix 2.4](#zabbix-24) + + [Zabbix 2.2](#zabbix-22) +- [Installation](#installation) +- [Role Variables](#role-variables) + * [Main variables](#main-variables) + + [Overall Zabbix](#overall-zabbix) + + [Zabbix Server](#zabbix-server) + + [Custom Zabbix Scripts](#custom-zabbix-scripts) + + [TLS Specific configuration](#tls-specific-configuration) + * [Database](#database) +- [Dependencies](#dependencies) +- [Example Playbook](#example-playbook) +- [Molecule](#molecule) +- [Contributors](#contributors) +- [License](#license) +- [Author Information](#author-information) + +# Overview + +Badges: + +[![Build Status](https://travis-ci.org/dj-wasabi/ansible-zabbix-server.svg?branch=master)](https://travis-ci.org/dj-wasabi/ansible-zabbix-server) + +This is a role for installing and maintaining the zabbix-server. + +This is one of the 'dj-wasabi' roles which configures your whole zabbix environment. See below for the complete list: + + * zabbix-web (https://galaxy.ansible.com/dj-wasabi/zabbix-web/) + * zabbix-server (https://galaxy.ansible.com/dj-wasabi/zabbix-server/) + * zabbix-proxy (https://galaxy.ansible.com/dj-wasabi/zabbix-proxy/) + * zabbix-javagateway (https://galaxy.ansible.com/dj-wasabi/zabbix-javagateway/) + * zabbix-agent (https://galaxy.ansible.com/dj-wasabi/zabbix-agent/) + +# Upgrades + +## 1.0.0 + +With this 1.0.0 release, the following is changed: + +* This repository will only contain all the actions that are needed for correctly configuring a Zabbix Server. All tasks regarding the frontend/webui of Zabbix has been transferred to the `dj-wasabi.zabbix-web` role. +* All properties start with `zabbix_` now. Example, property named `server_dbuser` is now `zabbix_server_dbuser`. + +# Requirements + +## Operating systems + +This role will work on the following operating systems: + + * Red Hat + * Debian + * Ubuntu + +So, you'll need one of those operating systems.. :-) +Please send Pull Requests or suggestions when you want to use this role for other Operating systems. + +## Zabbix Versions + +See the following list of supported Operating systems with the Zabbix releases: + +### Zabbix 4.4 + + * CentOS 7.x, 8.x + * Amazon 7.x + * RedHat 7.x, 8.x + * OracleLinux 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 + * RedHat 7.x + * OracleLinux 7.x + * Scientific Linux 7.x + * Ubuntu 14.04, 16.04, 18.04 + * Debian 8, 9 + +### Zabbix 4.0 + + * CentOS 7.x + * Amazon 7.x + * RedHat 7.x + * OracleLinux 7.x + * Scientific Linux 7.x + * Ubuntu 14.04, 16.04, 18.04 + * Debian 8, 9 + +### Zabbix 3.4 + + * CentOS 7.x + * Amazon 7.x + * RedHat 7.x + * OracleLinux 7.x + * Scientific Linux 7.x + * Ubuntu 14.04, 16.04 + * Debian 7, 8, 9 + + +### Zabbix 3.2 + + * CentOS 7.x + * Amazon 7.x + * RedHat 7.x + * OracleLinux 7.x + * Scientific Linux 7.x + * Ubuntu 14.04, 16.04 + * Debian 7, 8 + +### Zabbix 3.0 + + * CentOS 5.x, 6.x, 7.x + * Amazon 5.x, 6.x, 7.x + * RedHat 5.x, 6.x, 7.x + * OracleLinux 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 + * RedHat 6.x, 7.x + * OracleLinux 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 + * RedHat 5.x, 6.x + * OracleLinux 5.x, 6.x + * Scientific Linux 5.x, 6.x + * Ubuntu 12.04 + * Debian 7 + * xenserver 6 + +# Installation + +Installing this role is very simple: `ansible-galaxy install dj-wasabi.zabbix-server` + +Please be aware that this role only installs the Zabbix Server and not the Zabbix Web. If you do want to have a Zabbix Web, please execute the following command: `ansible-galaxy install dj-wasabi.zabbix-web` + +Default username/password for the Zabbix Web interface is the default one installed by Zabbix. + +Username: Admin +Password: zabbix + +# Role Variables + +## Main variables + +The following is an overview of all available configuration default for this role. + +### Overall Zabbix + +* `zabbix_server_version`: This is the version of zabbix. Default: 4.4. Can be overridden to 3.2, 3.0, 2.4, or 2.2. Previously the variable `zabbix_version` was used directly but it could cause [some inconvenience](https://github.com/dj-wasabi/ansible-zabbix-agent/pull/303). That variable is maintained by retrocompativility. +* `zabbix_repo_yum`: A list with Yum repository configuration. +* `zabbix_repo`: Default: _zabbix_ + * _epel_ install agent from EPEL repo + * _zabbix_ (default) install agent from Zabbix repo + * _other_ install agent from pre-existing or other repo +* `zabbix_server_package_state`: Default: _present_. Can be overridden to "latest" to update packages when needed. +* `zabbix_service_state`: Default: `started`. Can be overridden to stopped if needed +* `zabbix_service_enabled`: Default: `True` Can be overridden to `False` if needed +* `zabbix_selinux`: Enables an SELinux policy so that the server will run. Default: False. + +### Zabbix Server + +* `zabbix_server_name`: The name of the Zabbix Server. +* `zabbix_server_database`: The type of database used. Can be: mysql or pgsql +* `zabbix_server_database_long`: The type of database used, but long name. Can be: mysql or postgresql +* `zabbix_server_hostname`: The hostname on which the zabbix-server is running. Default set to: {{ inventory_hostname }} +* `zabbix_server_listenport`: On which port the Zabbix Server is available. Default: 10051 +* `zabbix_server_dbhost`: The hostname on which the database is running. +* `zabbix_server_real_dbhost`: The hostname of the dbhost that is running behind a loadbalancer/VIP (loadbalancers doesn't accept ssh connections) +* `zabbix_server_dbname`: The database name which is used by the Zabbix Server. +* `zabbix_server_dbuser`: The database username which is used by the Zabbix Server. +* `zabbix_server_dbpassword`: The database user password which is used by the Zabbix Server. +* `zabbix_server_dbport`: The database port which is used by the Zabbix Server. +* `zabbix_database_creation`: True / False. When you don't want to create the database including user, you can set it to False. +* `zabbix_server_install_recommends`: True / False. False does not install the recommended packages that come with the zabbix-server install. Default true +* `zabbix_server_install_database_client`: True / False. False does not install database client. Default true +* `zabbix_database_sqlload`:True / False. When you don't want to load the sql files into the database, you can set it to False. +* `zabbix_server_dbencoding`: The encoding for the MySQL database. Default set to `utf8` +* `zabbix_server_dbcollation`: The collation for the MySQL database. Default set to `utf8_bin` +* `zabbix_server_manage_service`: True / False. When you run multiple Zabbix servers in a High Available cluster setup (e.g. pacemaker), you don't want Ansible to manage the zabbix-server service, because Pacemaker is in control of zabbix-server service. + +### Custom Zabbix Scripts + +Define these variables to copy scripts to your respective scripts path. + +* `zabbix_server_alertscripts`: List of alertscripts to be added to `zabbix_server_alertscriptspath` +* `zabbix_server_externalscripts`: List of alertscripts to be added to `zabbix_server_externalscriptspath` + +Example: + +```bash + zabbix_server_alertscripts: + - path: "{{ lookup('first_found', 'zabbix-scripts/somescript.php') }}" + name: "somescript.php" +``` + +### TLS Specific configuration + +These variables are specific for Zabbix 3.0 and higher: + +* `zabbix_server_tlsconnect`: How the agent should connect to server or proxy. Used for active checks. + Possible values: + * unencrypted + * psk + * cert +* `zabbix_server_tlsaccept`: What incoming connections to accept. + Possible values: + * unencrypted + * psk + * cert +* `zabbix_server_tlscafile`: Full pathname of a file containing the top-level CA(s) certificates for peer certificate verification. +* `zabbix_server_tlscrlfile`: Full pathname of a file containing revoked certificates. +* `zabbix_server_tlsservercertissuer`: Allowed server certificate issuer. +* `zabbix_server_tlsservercertsubject`: Allowed server certificate subject. +* `zabbix_server_tlscertfile`: Full pathname of a file containing the agent certificate or certificate chain. +* `zabbix_server_tlskeyfile`: Full pathname of a file containing the agent private key. + +## Database + +There are some zabbix-server specific variables which will be used for the zabbix-server configuration file. These can be found in the defaults/main.yml file. There are 3 which need some explanation: +```bash + #zabbix_server_database: mysql + #zabbix_server_database_long: mysql + zabbix_server_database: pgsql + zabbix_server_database_long: postgresql + [...] + zabbix_server_dbport: 5432 +``` + +There are 2 database_types which will be supported: mysql and postgresql. You'll need to comment or uncomment the database you would like to use and adjust the port number (`server_dbport`) accordingly (`5432` is the default postgresql port). In example from above, the postgresql database is used. If you want to use mysql, uncomment the 2 lines from mysql and comment the 2 lines for postgresql and change the database port to the mysql one (default mysql port is `3306`). + +If you use mysql, then you should define mysql username, password and host to prepare zabbix database, otherwise they will be considered as their default value (and therefore, connecting to database will be considered as connecting to localhost with no password). The keys are below: + +```bash + zabbix_server_mysql_login_host + zabbix_server_mysql_login_user + zabbix_server_mysql_login_password +``` +If you use pgsql, then you should define pgsql username, password and host to prepare zabbix database, otherwise they will be considered as their default value (and therefore, connecting to database will be considered as connecting to localhost with no password). The keys are below: + +```bash + zabbix_server_pgsql_login_host + zabbix_server_pgsql_login_user + zabbix_server_pgsql_login_password +``` + + +# Dependencies + +For the databases you should find a role that suits your needs, as I don't want to force you for using a specific role. Before applying this Zabbix Server role, the database service should already be installed and running, and should be able to handle the modules in Ansible that belong to that database. + +This role will **not** install a MySQL or PostgreSQL service. + +This role will create a Zabbix user and a Zabbix database in the configured database type. + +# Example Playbook + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: zabbix-server + become: yes + roles: + - { role: dj-wasabi.zabbix-server, zabbix_server_database: mysql, zabbix_server_database_long: mysql } + + +# Molecule + +This role is configured to be tested with Molecule. You can find on these pages some more information regarding Molecule: + +* http://werner-dijkerman.nl/2016/07/10/testing-ansible-roles-with-molecule-testinfra-and-docker/ +* http://werner-dijkerman.nl/2016/07/27/extending-ansible-role-testing-with-molecule-by-adding-group_vars-dependencies-and-using-travis-ci/ +* http://werner-dijkerman.nl/2016/07/31/testing-ansible-roles-in-a-cluster-setup-with-docker-and-molecule/ + +# Contributors + +The following have contributed to this Ansible role (List of Fame): + + * drmikecrowe + * srvg + * kostyrevaa + * clopnis + * SAL-e + * lhoss + * mescanef + +# License + +MIT + +# Author Information + +This is my first attempt to create an ansible role, so please send suggestion or pull requests to make this role better. + +Github: https://github.com/dj-wasabi/ansible-zabbix-server + +mail: ikben [ at ] werner-dijkerman . nl diff --git a/docs/ZABBIX_WEB_ROLE.md b/docs/ZABBIX_WEB_ROLE.md new file mode 100644 index 000000000..164aafa61 --- /dev/null +++ b/docs/ZABBIX_WEB_ROLE.md @@ -0,0 +1,326 @@ +Table of Contents + +- [Overview](#overview) +- [Requirements](#requirements) + * [Operating Systems](#operating-systems) + * [Zabbix Versions](#zabbix-versions) + + [Zabbix 4.4](#zabbix-44) + + [Zabbix 4.2](#zabbix-42) + + [Zabbix 4.0](#zabbix-40) + + [Zabbix 3.4](#zabbix-34) + + [Zabbix 3.2](#zabbix-32) + + [Zabbix 3.0](#zabbix-30) + + [Zabbix 2.4](#zabbix-24) + + [Zabbix 2.2](#zabbix-22) +- [Installation](#installation) +- [Role Variables](#role-variables) + * [Main variables](#main-variables) + + [Overall Zabbix](#overall-zabbix) + + [Zabbix Web specific](#zabbix-web-specific) + + [Zabbix Server](#zabbix-server) + * [Examples of configuration](#examples-of-configuration) + + [zabbix_repo_yum](#zabbix-repo-yum) +- [Dependencies](#dependencies) +- [Example Playbook](#example-playbook) + * [Single instance](#single-instance) + * [Multi host setup](#multi-host-setup) + * [Adding Environment Variables for zabbix_web](#adding-environment-variables-for-zabbix-web) +- [Molecule](#molecule) +- [License](#license) +- [Author Information](#author-information) + +# Overview + +This role is migrated to: https://github.com/ansible-collections/community.zabbix/ +In this repository, a read only version is/will be available for those who can not make use of collections (yet). Changes/updates will only be applied to the collection and not in this repository. + +# Requirements +## Operating Systems + +This role will work on the following operating systems: + + * RedHat + * Debian + * Ubuntu + +So, you'll need one of those operating systems.. :-) +Please sent Pull Requests or suggestions when you want to use this role for other Operating Systems. + +## Zabbix Versions + +See the following list of supported Operating Systems with the Zabbix releases. + +### Zabbix 4.4 + * CentOS 7.x, 8.x + * Amazon 7.x + * RedHat 7.x, 8.x + * OracleLinux 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 + * RedHat 7.x + * OracleLinux 7.x + * Scientific Linux 7.x + * Ubuntu 14.04, 16.04, 18.04 + * Debian 8, 9 + +### Zabbix 4.0 + + * CentOS 7.x + * Amazon 7.x + * RedHat 7.x + * OracleLinux 7.x + * Scientific Linux 7.x + * Ubuntu 14.04, 16.04, 18.04 + * Debian 8, 9 + +### Zabbix 3.4 + + * CentOS 7.x + * Amazon 7.x + * RedHat 7.x + * OracleLinux 7.x + * Scientific Linux 7.x + * Ubuntu 14.04, 16.04 + * Debian 7, 8, 9 + +### Zabbix 3.2 + + * CentOS 7.x + * Amazon 7.x + * RedHat 7.x + * OracleLinux 7.x + * Scientific Linux 7.x + * Ubuntu 14.04, 16.04 + * Debian 7, 8 + +### Zabbix 3.0 + + * CentOS 5.x, 6.x, 7.x + * Amazon 5.x, 6.x, 7.x + * RedHat 5.x, 6.x, 7.x + * OracleLinux 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 + * RedHat 6.x, 7.x + * OracleLinux 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 + * RedHat 5.x, 6.x + * OracleLinux 5.x, 6.x + * Scientific Linux 5.x, 6.x + * Ubuntu 12.04 + * Debian 7 + * xenserver 6 + +# Installation + +Installing this role is very simple: `ansible-galaxy install dj-wasabi.zabbix-web` + +When the Zabbix Web needs to be running on the same host as the Zabbix Server, please also install the Zabbix Server by executing the following command: `ansible-galaxy install dj-wasabi.zabbix-server` + + Default username/password for the Zabbix Web interface is the default. + + Username: Admin + Password: zabbix + +# Role Variables + +## Main variables + +The following is an overview of all available configuration defaults for this role. + +### Overall Zabbix + +* `zabbix_web_version`: This is the version of zabbix. Default: 4.4, Can be overridden to 4.0, 3.4, 3.2, 3.0, 2.4, or 2.2. Previously the variable `zabbix_version` was used directly but it could cause [some inconvenience](https://github.com/dj-wasabi/ansible-zabbix-agent/pull/303). That variable is maintained by retrocompativility. +* `zabbix_repo_yum`: A list with Yum repository configuration. +* `zabbix_web_package_state`: Default: _present_. Can be overridden to "latest" to update packages when needed. + +### Zabbix Web specific + +* `zabbix_url`: This is the url on which the zabbix web interface is available. Default is zabbix.example.com, you should override it. For example, see "Example Playbook" +* `zabbix_url_aliases`: A list with Aliases for the Apache Virtual Host configuration. +* `zabbix_timezone`: This is the timezone. The Apache Virtual Host needs this parameter. Default: Europe/Amsterdam +* `zabbix_vhost`: True / False. When you don't want to create an Apache Virtual Host configuration, you can set it to False. +* `zabbix_apache_vhost_port`: The port on which Zabbix HTTP vhost is running. +* `zabbix_apache_vhost_tls_port`: The port on which Zabbix HTTPS vhost is running. +* `zabbix_apache_vhost_port`: On which port the Apache Virtual Host is available. +* `zabbix_apache_vhost_listen_ip`: On which interface the Apache Virtual Host is available. +* `zabbix_apache_can_connect_ldap`: True / False. Set SELinux boolean to allow httpd to connect to LDAP. Default is False. +* `zabbix_php_install`: True / False. Switch for extra install of packages for PHP, currently on for Debian/Ubuntu. Default is true. +* `zabbix_web_max_execution_time`: +* `zabbix_web_memory_limit`: +* `zabbix_web_post_max_size`: +* `zabbix_web_upload_max_filesize`: +* `zabbix_web_max_input_time`: +* `zabbix_apache_include_custom_fragment`: True / False. Includes php_value vars max_execution_time, memory_limit, post_max_size, upload_max_filesize, max_input_time and date.timezone in vhost file.. place those in php-fpm configuration. Default is true. +* `zabbix_web_env`: (Optional) A Dictionary of PHP Environments + +The following properties are related when TLS/SSL is configured: + +* `zabbix_apache_tls`: If the Apache vhost should be configured with TLS encryption or not. +* `zabbix_apache_redirect`: If a redirect should take place from HTTP to HTTPS +* `zabbix_apache_tls_crt`: The path to the TLS certificate file. +* `zabbix_apache_tls_key`: The path to the TLS key file. +* `zabbix_apache_tls_chain`: The path to the TLS certificate chain file. +* `zabbix_apache_SSLPassPhraseDialog`: Type of pass phrase dialog for encrypted private keys. +* `zabbix_apache_SSLSessionCache`: Type of the global/inter-process SSL Session Cache +* `zabbix_apache_SSLSessionCacheTimeout`: Number of seconds before an SSL session expires in the Session Cache +* `zabbix_apache_SSLCryptoDevice`: Enable use of a cryptographic hardware accelerator + +When `zabbix_apache_tls_crt`, `zabbix_apache_tls_key` and/or `zabbix_apache_tls_chain` are used, make sure that these files exists before executing this role. The Zabbix-Web role will not install the mentioned files. + +See https://httpd.apache.org/docs/current/mod/mod_ssl.html for SSL* configuration options for Apache HTTPD. + +### Zabbix Server + +* `zabbix_server_name`: The name of the Zabbix Server. +* `zabbix_server_database`: The type of database used. Can be: mysql or pgsql +* `zabbix_server_database_long`: The type of database used, but long name. Can be: mysql or postgresql +* `zabbix_server_hostname`: The hostname on which the zabbix-server is running. Default set to: {{ inventory_hostname }} +* `zabbix_server_listenport`: On which port the Zabbix Server is available. Default: 10051 +* `zabbix_server_dbhost`: The hostname on which the database is running. +* `zabbix_server_dbname`: The database name which is used by the Zabbix Server. +* `zabbix_server_dbuser`: The database username which is used by the Zabbix Server. +* `zabbix_server_dbpassword`: The database user password which is used by the Zabbix Server. +* `zabbix_server_dbport`: The database port which is used by the Zabbix Server. + +The following properties are related when using Elasticsearch for history storage: + +* `zabbix_server_history_url`: String with url to the Elasticsearch server or a list if the types are stored on different Elasticsearch URLs. +* `zabbix_server_history_types`: List of history types to store in Elasticsearch. + +See the following links for more information regarding Zabbix and Elasticsearch +https://www.zabbix.com/documentation/3.4/manual/appendix/install/elastic_search_setup +https://www.zabbix.com/documentation/4.0/manual/appendix/install/elastic_search_setup + +## Examples of configuration + +### zabbix_repo_yum + +Current default configuration and example for specifying a yum repository: + +```` +zabbix_repo_yum: + - name: zabbix + description: Zabbix Official Repository - $basearch + baseurl: http://repo.zabbix.com/zabbix/{{ zabbix_version }}/rhel/{{ ansible_distribution_major_version }}/$basearch/ + gpgcheck: 0 + gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX + state: present + - name: zabbix + description: Zabbix Official Repository non-supported - $basearch + baseurl: http://repo.zabbix.com/non-supported/rhel/{{ ansible_distribution_major_version }}/$basearch/ + gpgcheck: 0 + gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX + state: present +```` + +# Dependencies + +This role has one dependency for Apache usage: geerlingguy.apache. Via the variable zabbix_websrv != 'apache' this can be skipped. + +As it is also possible to run the zabbix-web on a different host than the zabbix-server, the zabbix-server is not configured to be an dependency. + +# Example Playbook + +There are two ways of using the zabbix-web: + +* Single instance +* Multi host setup + +## Single instance + +When there is one host running both Zabbix Server and the Zabbix Web (Running MySQL as database): + +``` +- hosts: zabbix-server + become: yes + roles: + - { role: geerlingguy.apache } + - { role: dj-wasabi.zabbix-server, zabbix_server_database: mysql, zabbix_server_database_long: mysql, zabbix_server_dbport: 3306 } + - { role: dj-wasabi.zabbix-web, zabbix_url: zabbix.dj-wasabi.nl, zabbix_server_database: mysql, zabbix_server_database_long: mysql, zabbix_server_dbport: 3306} +``` + +## Multi host setup + +This is a two host setup. On one host (Named: "zabbix-server") the Zabbix Server is running, and the other host (Named: zabbix-web) runs Zabbix Web (with MySQL as database): + +``` +- hosts: zabbix-server + become: yes + roles: + - { role: dj-wasabi.zabbix-server, zabbix_server_database: mysql, zabbix_server_database_long: mysql, zabbix_server_dbport: 3306 } + +- hosts: zabbix-web + become: yes + roles: + - { role: geerlingguy.apache } + - { role: dj-wasabi.zabbix-web, zabbix_server_hostname: zabbix-server, zabbix_url: zabbix.dj-wasabi.nl, zabbix_server_database: mysql, zabbix_server_database_long: mysql, zabbix_server_dbport: 3306 } +``` + +## Adding Environment Variables for zabbix_web + +Sometimes you need to add environment variables to your +zabbix.conf.php, for example to add LDAP CA certificates. To do this add a `zabbix_web_env` dictionary: + +``` +- { role: dj-wasabi.zabbix-web, zabbix_url: zabbix.dj-wasabi.nl, zabbix_server_database: mysql, zabbix_server_database_long: mysql, zabbix_server_dbport: 3306, zabbix_web_env: {LDAPTLS_CACERT: /etc/ssl/certs/ourcert.pem} +``` + +## Using Elasticsearch for history storage + +To use Elasticsearch for history storage you need to configure the `zabbix_server_history_url` and `zabbix_server_history_types`. You will also need to configure Elasticsearch +in the zabbix-server (https://galaxy.ansible.com/dj-wasabi/zabbix-server/) role. + +Zabbix can store the following history types +in Elasticsearch: +* Numeric (unsigned) - `uint` +* Numeric (float) - `dbl` +* Character - `str` +* Log - `log` +* Text - `text` + +To store all history types in the same history URL the following variables should be set (make sure history url points to your Elasticsearch cluster): + +``` +zabbix_server_history_url: "http://localhost:9200" +zabbix_server_history_types: + - 'str' + - 'text' + - 'log' + - 'uint' + - 'dbl' +``` + +# Molecule + +This role is configured to be tested with Molecule. Molecule will boot at least 3 different kinds of containers, one for each supported Operating System (Debian, Ubuntu and RedHat). +Pull Requests are only merged when the tests are successful. + +For more information, please check the following page: https://www.werner-dijkerman.nl/2016/07/10/testing-ansible-roles-with-molecule-testinfra-and-docker + +# License + +MIT + +# Author Information + +Github: https://github.com/dj-wasabi/ansible-zabbix-web + +mail: ikben [ at ] werner-dijkerman . nl diff --git a/roles/zabbix_agent/CHANGELOG.md b/roles/zabbix_agent/CHANGELOG.md deleted file mode 100644 index e2fc1d098..000000000 --- a/roles/zabbix_agent/CHANGELOG.md +++ /dev/null @@ -1,294 +0,0 @@ -# Ansible Zabbix Agent release - -Below an overview of all changes in the releases. - -Version (Release date) - -FINAL and LAST release for this role in this repository. This role will be transferred to: https://github.com/ansible-collections/community.zabbix/ - -2.3.0 (2020-05-05) - - * Prevent to run multiple time installation on localhost #334 (By pull request: SimBou (Thanks!)) - * Add support for XCP-ng as a dialect of RHEL7 #335 (By pull request: KurtSchluss (Thanks!)) - * Fix: Changed apt state to present from installed. #336 (By pull request: sebedh (Thanks!)) - * Selinux boolean to allow zabbix to run sudo commands #340 (By pull request: Vinclame (Thanks!)) - * Added performance userparameter.yml on Windows #342 (By pull request: ComradeAx0n (Thanks!)) - * Added some missing ubuntu ids #344 - -2.2.0 (2020-03-07) - - * Add weight for apt #333 - * Added property zabbix_agent_src_reinstall so it will succeed the idem… #332 - * Set the correct until which had a wrong value #330 - * Partly reverting change for Debian #329 - * Added debian #327 - * Reorder task based on issue #326 - * Removing deprication warnings #325 - * Removed the as it will add a proxy line that blocks everything #324 - * adding empty dict to zabbix_agent_inventory_zabbix #323 (By pull request: tobiasehlert (Thanks!)) - * setting value for zabbix_agent_ipmi_authtype and zabbix_agent_ipmi_privilege #319 (By pull request: tobiasehlert (Thanks!)) - * Preventing of adding empty ListenIP= to the config file #318 (By pull request: ddyugaev (Thanks!)) - * Use proxy if defined (Windows) #316 (By pull request: lingfish (Thanks!)) - * RedHat proxy set in repo file #315 (By pull request: lingfish (Thanks!)) - * Windows agent download link fix #313 (By pull request: ddyugaev (Thanks!)) - * Apply proxy settings when installing deb-src repositories #312 (By pull request: KurtSchluss (Thanks!)) - * added additional zabbix_host parameter #307 (By pull request: pugnacity (Thanks!)) - * fix check mode on Windows #305 (By pull request: Poil (Thanks!)) - * Move up task 'Override architecture if 64-bit' #304 (By pull request: Gati0 (Thanks!)) - * Avoid conflicts with the zabbix_version and zabbix_url variables #303 (By pull request: santiagomr (Thanks!)) - * Fix incorrect handler names #299 (By pull request: gunnarbeutner (Thanks!)) - * Implement support for macOS #298 (By pull request: gunnarbeutner (Thanks!)) - * Improving readability and avoiding repeated code #296 (By pull request: santiagomr (Thanks!)) - * 'Template OS Linux' doesn't exist in Zabbix 4.4 #295 - * Add follow_redirects for download Windows-Agent on Windows #294 (By pull request: Gati0 (Thanks!)) - -2.1.0 (2019-11-25) - - * Fix typos #274 (By pull request: akamch (Thanks!)) - * Added retry for API related tasks #275 - * Added missing task for adding a TLS-PSK file #280 - * Remove the host running Docker from Molecule for now #281 - * Updating to Zabbix 4.4 #282 - * Trying to use a Matrix in Travis and see what happens.. :-) - * Pass params to Ansible Zabbix modules used by role to allow HTTP Basi… #285 (By pull request: nadley (Thanks!)) - * RHEL8 specific changes for SELinux #286 (By pull request: bdekker-routit (Thanks!)) - * userparameters from parametizable sources #287 (By pull request: santiagomr (Thanks!)) - * Added cosmic to the zabbix.yml vars file. - -2.0.0 (2019-09-29) - - * Using Ansible 2.7 as minimal version; - * fix repository problem #236 (By pull request: kmonticolo (Thanks!)) - * Added ansible_python_interpreter for Fedora #238 - * Allow to use a (http|https) proxy for downloading of packages #239 - * fix repository problem #240 (By pull request: kmonticolo (Thanks!)) - * Add Debian 10 (buster) for Zabbix 4.2,4.0 and 3.0 #243 (By pull request: patede (Thanks!)) - * Add "vars" tag to include variables #247 (By pull request: j8r (Thanks!)) - * Introduce AutoPSK for easy encryption; Closes dj-wasabi/ansible-zabbix-agent#250 #251 (By pull request: kr4ut (Thanks!)) - * Install selinux-policy-targeted (dependency) #255 (By pull request: Maelstrom96 (Thanks!)) - * Add support to FreePBX #261 (By pull request: darco1991 (Thanks!)) - * Add support for firewalld zone #262 (By pull request: darco1991 (Thanks!)) - * Fix group membership zabbix_agent.d dir according to #246 #264 - * According to #263 1100 needs to be added to the sc.exe call #265 - * Changing gpg keys #267 - * Added suggested task for correct installation of Zabbix on Amazon #270 - * Added some properties for configuring iptables #271 - * Bare variable deprecation #272 (By pull request: average-joe (Thanks!)) - * Moving zabbix_agent_ip to Linux.yml and create a new one for Windows.yml #268 - -1.7.1 (2019-06-04) - - * Revert breaking changes #232 (By pull request: crazikPL (Thanks!)) - -1.7.0 (2019-05-30) - - * Updated to Zabbix 4.2 to default installations #221 - * Fixed for the default scenario the warnings #222 - * Add Windows Agent update and service auto-recovery #223 (By pull request: pimooss (Thanks!)) - * Added Docker image #224 - * Add details on requiring sudo access for python-netaddr #226 (By pull request: willhallonline (Thanks!)) - * Defining different jmx port number to configuring firewall #227 (By pull request: 0utsider (Thanks!)) - * Update syntax to ansible 2.8 #228 (By pull request: crazikPL (Thanks!)) - * Use EPEL 7 when Amazon 2 #230 (By pull request: bkmeneguello (Thanks!)) - -1.6.1 (2019-04-12) - - * Update userparameter.yml #215 (By pull request: Jookadin (Thanks!)) - * Pip packages install variable #217 (By pull request: rnsc (Thanks!)) - * Added task that was previously in role #219 - -1.6.0 (2019-03-13) - - * Added task for installation of the zabbix-api package #191 - * Restart agent when PSK file changes (fixes #193) #194 (By pull request: pigulla (Thanks!)) - * Added a until loop to retry installations as suggested by ansible-lint #195 - * Add fedora 29 support #199 (By pull request: average-joe (Thanks!)) - * Set default values if property is undefined #203 - * Add installation of pip package netaddr #204 - * Add option not to elevate privileges locally #206 (By pull request: dennisse (Thanks!)) - * Windows zabbix agent handler #209 (By pull request: rnsc (Thanks!)) - * Add Bionic to sign keys for zabbix-agent v3.0 and v3.2 #211 (By pull request: mamedin (Thanks!)) - * Fix for: zabbix_agent_tlsconnect and zabbix_agent_tlsaccept are mixed #205 - * Fix for: Role Should NOT Smash Ansible Facts #207 - -1.5.0 (2018-10-19) - - * Added installation on Windows - * Firewalld #166 (By pull request: 0utsider (Thanks!)) - * Using same container as with the server #167 - * Zabbix 4.0 now default installation - * enable support for https enabled zabbix frontends/apis #173 (By pull request: rolfvreijdenberger (Thanks!)) - -1.4.0 (2018-09-11) - - * Add configuration to prevent host updating via zabbix api #150 (By pull request: sblaisot (Thanks!)) - * Handle encryption when adding host to zabbix server #151 (By pull request: sblaisot (Thanks!)) - * Removed the warning message #156 - * Updating versions to be installed #157 - * Added 2nd Molecule Scenario #158 - * Parameterizing userparameter deployment #159 (By pull request: rubentsirunyan (Thanks!)) - * fix typo #160 (By pull request: kmonticolo (Thanks!)) - * Reflect changed license in README #161 (By pull request: stephankn (Thanks!)) - * remove deprecated loop #162 (By pull request: stephankn (Thanks!)) - * Fix when running ansible in --check mode #163 (By pull request: AlbanAndrieu (Thanks!)) - -1.3.0 (2018-06-23) - - * fixes issue "Configure iptables task fail" #128 (By pull request: andreagrax (Thanks!)) - * Fix travis docker #131 - * Added several 'become: yes' to tasks #133 - * Added gpg key id for agent version 3.0 in Debian Stretch #135 (By pull request: hatifnatt (Thanks!)) - * Upgrade minimum Ansible version from 1.9 --> 2.4 - * Added a License, Code of Conduct and some more files - * Fix for Misleading repo name #147 - * fixes for the userparameter task #138 (By pull request: HNKNTA (Thanks!)) - * Support for Debian 9 and Ubuntu 18.04 - * Added fix for: Host autoregistered in zabbix with IP 0.0.0.0 when Lis… #141 - -1.2.0 (2018-01-25) - - * Fix for: Some RedHat subtask are missing become option #116 - * Delete option "run_once" from task "Create hostgroups" #119 (By pull request: mgornikov (Thanks!)) - * Fix the CI Travis build again. - * Fix for: Changing zabbix_version breaks role #117 - * Added sonya #120 - * Add clean all #121 - * allow 127.0.0.1 for listenip #124 (By pull request: blodone (Thanks!)) - * Get selinux status #125 (By pull request: andreagrax (Thanks!)) - * Add new variable zabbix_visible_hostname #126 (By pull request: samyscoub (Thanks!)) - * Replaced `yum` with `package` #127 (By pull request: average-joe (Thanks!)) - -1.1.0 (2017-11-13) - - * Add zabbix_ to agent_serveractive and agent_server #101 (By pull request: asosso (Thanks!)) - * Fix typo #102 (By pull request: asosso (Thanks!)) - * Added support for Zabbix host inventory mode #103 (By pull request: mgornikov (Thanks!)) - * Trying to fix mint #105 - * Do not report as change when update an existing host's info #107 (By pull request: asosso (Thanks!)) - * Add default value for zabbix_inventory_mode #108 (By pull request: asosso (Thanks!)) - * Added IPtables #111 - * Added when for enabling repo when zabbix_repo==zabbix #112 - * Added stretch for Zabbix 3.2 #115 - -1.0.3 (2017-09-07) - - * Fix attempt two for: zabbix_agent_listenip not working as expected #98 - * Updated Molecule V1 test to Molecule V2. - -1.0.2 (2017-09-03) - - * Fix for: zabbix_agent_listenip not working as expected #98 - * Fix for: s/agent_interfaces/zabbix_agent_interfaces #95 && 'agent_interfaces' is undefined #94 - * Forgot to update documentation with the new variable names (Added the `zabbix_` prefixes.) - -1.0.1 (2017-08-31) - - * Fix for: Error in: Create directory for PSK file if not exist - -1.0.0 (2017-08-30) - - * From ini to yml style. - * Used yum instead of apt #78 - * Installing default 3.4. - * Prefixed all properties that started with `agent_` with the value `zabbix_`. - * [DOCS] Fix readme for zabbix_api_create_hosts #82 (By pull request: Logan2211 (Thanks!)) - * Workaround https://github.com/ansible/ansible-modules-core/issues/3764 #85 (By pull request: ma-tty (Thanks!)) - * Added Mint #88 - * Include Debian stretch in 3.4 #89 (By pull request: rtgibbons (Thanks!)) - * Add creation of PSK file #90 - * Fix for: Key-dependent repository installed before the key #80 - * Set Molecule to V1 for now since V2 is released. - -0.10.0 (2017-07-25) - - * Added run_once to only execute the task once #77 - * Adds zabbix_selinux variable to README #75 - * Adding tasks for selinux #74 - * Fix type number of jmx/ipmi #65 (By pull request: fazelgh (Thanks!)) - * zabbix_hostmacro fix #64 (By pull request: dguihal (Thanks!)) - * Does not confuse with zabbix_api_use setting. #61 (By pull request: i5513 (Thanks!)) - * get gpg key over https #60 (By pull request: sjugge (Thanks!)) - * Using the same version handling as with the zabbix-server #59 - -0.9.0 (2016-12-30) - - * Fix hostname mistmatch when updating macros #54 (By pull request: tahajahangir (Thanks!)) - * Update main.yml #52 (By pull request: envrm (Thanks!)) - * Added zabbix.yml vars for correct apt_key id #48 - * Updated to Zabbix 3.2.0 #47 - * Fix missed tag #43 (By pull request: leominov (Thanks!)) - * Set everything the same with agent_hostname - -0.8.0 (2016-08-24) - - * Added more tests for Molecule - * Configured Travis to execute the Molecule tests - * specified become for local tasks #33 (By pull request: kam1kaze (Thanks!)) - * add proxy param to zabbix api #34 (By pull request: kam1kaze (Thanks!)) - * Fix for: zabbix 3 JMX interface Added property `agent_interfaces` to configure the interfaces via the API. - * Fix for: skip zabbix_group module (Replaced `zabbix_api_use` by the properties `zabbix_api_create_hostgroup` and `zabbix_api_create_hosts`) - -0.7.0 (2016-07-11) - - * Fix for: zabbix_repo - inconsistent use between server and agent roles. #17 - * Fix for: apache 2.2. and 2.4 #15 - * Removed Test Kitchen tests and added Molecule tests. - * remove deprecated py scripts in library dir #32 (By pull request: mescanef (Thanks!)) - -0.6.0 (2016-05-12) - - * Changed sudo to become. #30 (By pull request: UnderGreen (Thanks!)) - * No reason for zabbix to able to change its own config #25 (By pull request: burner1024 (Thanks!)) - * Updated documentation for Zabbix 3.0 - * Updated Zabbix 3.0 OS list - * Fixed tests - -0.5.0 (2016-02-16) - - * Zabbix 3.0 - * Moved "set_facts" to var files. - * Added basic travis-si test. - -0.4.0 (2016-01-31) - - * zabbix_host_groups not working as expected #4 (By pull request: Pion (Thanks!)) - * set cache_valid_time=0 to ensure an apt-get update after the added repo-key (By pull request: lhoss (Thanks!)) - * Add api tag to set_fact. Fixes #19 (By pull request: kostyrevaa (Thanks!)) - * add sudo, and add zabbix-api dependency to readme.md (By pull request: Savemech (Thanks!)) - * default zabbix_agent to all interfaces #14 (By pull request: dlbewley (Thanks!)) - * enable use of EPEL packages #11 (By pull request: dlbewley (Thanks!)) - * Fixed kitchen test setup - * Removed zabbix_group (is already in Ansible), updated zabbix_host - * Added tag: zabbix-agent - -0.3.0 (2015-08-25) - - * Fixes for RHEL 6 Server on ansible 1.9.2 #10 (By pull request: bwaters (Thanks!)) - * remove macros from defaults fixes issue #7 (By pull request: kostyrevaa (Thanks!)) - * defaults/main.yml is not in line with the README #5 (By pull request: dhxgit (Thanks!)) - * Added empty dependencies list to meta/main.yml #3 (By pull request: neneko-mun (Thanks!)) - * Ubuntu is uppercase in ansible_distribution #2 (By pull request: wascheck (Thanks!)) - -0.2.1 (2015-03-20) - - * Create hostgroups requires zabbix_api #1 (By pull request: wascheck (Thanks!)) - -0.2.0 (2015-03-06) - - * Added some "cove" modules for automatically creating agents in webinterface via api - * Updated template for correct listeninterface - -0.1.0 (2015-02-01) - - * Updated readme; added double quotes on names; added var zabbix_repo; - -0.0.2 (2014-11-05) - - * Added suse as operating system - * Updated documentation - * Updated the name for the debian repositories for including deb or deb-src - - -0.0.1 (2014-11-01) - - * Initial Version diff --git a/roles/zabbix_agent/LICENSE b/roles/zabbix_agent/LICENSE deleted file mode 100644 index 6922fb326..000000000 --- a/roles/zabbix_agent/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Werner Dijkerman - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/roles/zabbix_agent/PULL_REQUEST_TEMPLATE.md b/roles/zabbix_agent/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 70c5edefc..000000000 --- a/roles/zabbix_agent/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,12 +0,0 @@ -**Description of PR** - - -**Type of change** - - -Feature Pull Request -Bugfix Pull Request -Docs Pull Request - -**Fixes an issue** - diff --git a/roles/zabbix_agent/README.md b/roles/zabbix_agent/README.md deleted file mode 100644 index 742cea4db..000000000 --- a/roles/zabbix_agent/README.md +++ /dev/null @@ -1,604 +0,0 @@ -Table of Contents - -- [Overview](#overview) -- [Requirements](#requirements) - * [Operating systems](#operating-systems) - * [Local system access](#local-system-access) - * [Zabbix Versions](#zabbix-versions) - + [Zabbix 4.4](#zabbix-44) - + [Zabbix 4.2](#zabbix-42) - + [Zabbix 4.0](#zabbix-40) - + [Zabbix 3.4](#zabbix-34) - + [Zabbix 3.2](#zabbix-32) - + [Zabbix 3.0](#zabbix-30) - + [Zabbix 2.4](#zabbix-24) - + [Zabbix 2.2](#zabbix-22) -- [Getting started](#getting-started) - * [Installation](#installation) - * [Minimal Configuration](#minimal-configuration) - * [Issues](#issues) -- [Role Variables](#role-variables) - * [Main variables](#main-variables) - * [TLS Specific configuration](#tls-specific-configuration) - * [Zabbix API variables](#zabbix-api-variables) - * [Windows Variables](#windows-variables) - * [Docker Variables](#docker-variables) - * [Other variables](#other-variables) - * [proxy](#proxy) -- [Dependencies](#dependencies) -- [Example Playbook](#example-playbook) - * [agent_interfaces](#agent-interfaces) - * [Other interfaces](#other-interfaces) - * [Vars in role configuration](#vars-in-role-configuration) - * [Combination of group_vars and playbook](#combination-of-group-vars-and-playbook) - * [Example for TLS PSK encrypted agent communication](#example-for-tls-psk-encrypted-agent-communication) -- [Molecule](#molecule) - * [default](#default) - * [with-server](#with-server) - * [before-last-version](#before-last-version) -- [Deploying Userparameters](#deploying-userparameters) -- [License](#license) -- [Author Information](#author-information) - -# Introduction - -This role is migrated to: https://github.com/ansible-collections/community.zabbix/ -In this repository, a read only version is/will be available for those who can not make use of collections (yet). Changes/updates will only be applied to the collection and not in this repository. - -# Requirements -## Operating systems -This role will work on the following operating systems: - - * Red Hat - * Fedora - * Debian - * Ubuntu - * opensuse - * Windows (Best effort) - * macOS - -So, you'll need one of those operating systems.. :-) -Please sent Pull Requests or suggestions when you want to use this role for other Operating systems. - -## Local system access - -To successfully complete the install the role requires `python-netaddr` on the controller to be able to manage IP addresses. This requires that the library is available on your local machine (or that `pip` is installed to be able to run). This will likely mean that running the role will require `sudo` access to your local machine and therefore you may need the `-K` flag to be able to enter your local machine password if you are not running under root. - -## Zabbix Versions - -See the following list of supported Operating systems with the Zabbix releases: - -### Zabbix 4.4 - - * CentOS 7.x, 8.x - * Amazon 7.x - * RedHat 7.x, 8.x - * Fedora 27, 29 - * OracleLinux 7.x, 8.x - * Scientific Linux 7.x, 8.x - * Ubuntu 14.04, 16.04, 18.04 - * Debian 8, 9, 10 - * macOS 10.14, 10.15 - -### Zabbix 4.2 - - * CentOS 7.x - * Amazon 7.x - * RedHat 7.x - * Fedora 27, 29 - * OracleLinux 7.x - * Scientific Linux 7.x - * Ubuntu 14.04, 16.04, 18.04 - * Debian 8, 9, 10 - * macOS 10.14, 10.15 - -### Zabbix 4.0 - - * CentOS 7.x - * Amazon 7.x - * RedHat 7.x - * Fedora 27, 29 - * OracleLinux 7.x - * Scientific Linux 7.x - * Ubuntu 14.04, 16.04, 18.04 - * Debian 8, 9, 10 - * macOS 10.14, 10.15 - -### Zabbix 3.4 - - * CentOS 7.x - * Amazon 7.x - * RedHat 7.x - * Fedora 27, 29 - * OracleLinux 7.x - * Scientific Linux 7.x - * Ubuntu 14.04, 16.04, 18.04 - * Debian 7, 8, 9 - -### Zabbix 3.2 - - * CentOS 7.x - * Amazon 7.x - * RedHat 7.x - * Fedora 27, 29 - * OracleLinux 7.x - * Scientific Linux 7.x - * Ubuntu 14.04, 16.04 - * Debian 7, 8 - -### Zabbix 3.0 - - * CentOS 5.x, 6.x, 7.x - * Amazon 5.x, 6.x, 7.x - * RedHat 5.x, 6.x, 7.x - * OracleLinux 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 - * RedHat 6.x, 7.x - * OracleLinux 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 - * RedHat 5.x, 6.x - * OracleLinux 5.x, 6.x - * Scientific Linux 5.x, 6.x - * Ubuntu 12.04 - * Debian 7 - * xenserver 6 - -# Getting started - -## Installation - -Installing this role is very simple: `ansible-galaxy install dj-wasabi.zabbix-agent` - -This will install the zabbix-agent role into your `roles` directory. - -## Minimal Configuration - -In order to get the Zabbix Agent running, you'll have to define the following properties before executing the role: - -* zabbix_agent_version -* zabbix_agent_server -* zabbix_agent_serveractive (When using active checks) - -The `zabbix_agent_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_agent_version: 4.0`, `zabbix_agent_version: 3.4` or `zabbix_agent_version: 2.2`. - -The `zabbix_agent_server` (and `zabbix_agent_serveractive`) should contain the ip or fqdn of the host running the Zabbix Server. - -## Issues - -Due to issue discussed on [#291](https://github.com/dj-wasabi/ansible-zabbix-agent/issues/291), the Ansible Version 2.9.{0,1,2} isn't working correctly on Windows related targets. - -# Role Variables - -## Main variables - -There are some variables in default/main.yml which can (or need to) be overridden: - -* `zabbix_agent_server`: The ip address for the zabbix-server or zabbix-proxy. - -* `zabbix_agent_serveractive`: The ip address for the zabbix-server or zabbix-proxy for active checks. - -* `zabbix_agent_version`: This is the version of zabbix. Default it is 4.4, but can be overridden to one of the versions mentioned in [Zabbix Versions](#zabbix-versions). Previously the variable `zabbix_version` was used directly but it could cause [some inconvenience](https://github.com/dj-wasabi/ansible-zabbix-agent/pull/303). That variable is maintained by retrocompativility. - -* `zabbix_repo`: Default: _zabbix_ - * _epel_ install agent from EPEL repo - * _zabbix_ (default) install agent from Zabbix repo - * _other_ install agent from pre-existing or other repo - -* `zabbix_agent_listeninterface`: Interface zabbix-agent listens on. Leave blank for all. - -* `zabbix_agent_package`: The name of the zabbix-agent package. Default: `zabbix-agent`. In case for EPEL, it is automatically renamed. - -* `zabbix_sender_package`: The name of the zabbix-sender package. Default: `zabbix-sender`. In case for EPEL, it is automatically renamed. - -* `zabbix_get_package`: The name of the zabbix-get package. Default: `zabbix-get`. In case for EPEL, it is automatically renamed. - -* `zabbix_agent_package_state`: If Zabbix-agent needs to be present or latest. - -* `zabbix_agent_interfaces`: A list that configured the interfaces you can use when configuring via API. - -* `zabbix_selinux`: Enables an SELinux policy so that the agent will run. Default: False. - -* `zabbix_agent_userparameters`: List of userparameter names and scripts (if any). Detailed description is given in the [Deploying Userparameters](#deploying-userparameters) section. Default: `[]` (Empty list). - * `name`: Userparameter name (should be the same with userparameter template file name) - * `scripts_dir`: Directory name of the custom scripts needed for userparameters - -* `zabbix_agent_userparameters_templates_src`: indicates the relative path (from `templates/`) where userparameter templates are searched - -* `zabbix_agent_userparameters_scripts_src`: indicates the relative path (from `files/`) where userparameter scripts are searched - -* `zabbix_agent_allowroot`: Allow the agent to run as 'root'. 0 - do not allow, 1 - allow - -* `zabbix_agent_runas_user`: Drop privileges to a specific, existing user on the system. Only has effect if run as 'root' and AllowRoot is disabled. - -* `zabbix_agent_become_on_localhost`: Set to `False` if you don't need to elevate privileges on localhost to install packages locally with pip. Default: True - -* `zabbix_install_pip_packages`: Set to `False` if you don't want to install the required pip packages. Useful when you control your environment completely. Default: True - -* `zabbix_agent_apt_priority`: Add a weight (`Pin-Priority`) for the APT repository. - -## TLS Specific configuration - -These variables are specific for Zabbix 3.0 and higher: - -* `zabbix_agent_tlsconnect`: How the agent should connect to server or proxy. Used for active checks. - - Possible values: - - * unencrypted - * psk - * cert - -* `zabbix_agent_tlsaccept`: What incoming connections to accept. - - Possible values: - - * unencrypted - * psk - * cert - -* `zabbix_agent_tlscafile`: Full pathname of a file containing the top-level CA(s) certificates for peer certificate verification. - -* `zabbix_agent_tlscrlfile`: Full pathname of a file containing revoked certificates. - -* `zabbix_agent_tlsservercertissuer`: Allowed server certificate issuer. - -* `zabbix_agent_tlsservercertsubject`: Allowed server certificate subject. - -* `zabbix_agent_tlscertfile`: Full pathname of a file containing the agent certificate or certificate chain. - -* `zabbix_agent_tlskeyfile`: Full pathname of a file containing the agent private key. - -* `zabbix_agent_tlspskidentity`: Unique, case sensitive string used to identify the pre-shared key. - -* `zabbix_agent_tlspskidentity_file`: Full pathname of a file containing the pre-shared key identity. - -* `zabbix_agent_tlspskfile`: Full pathname of a file containing the pre-shared key. - -* `zabbix_agent_tlspsk_secret`: The pre-shared secret key that should be placed in the file configured with `agent_tlspskfile`. - -* `zabbix_agent_tlspsk_auto`: Enables auto generation and storing of individual pre-shared keys and identities on clients. - -## Zabbix API variables - -These variables need to be overridden when you want to make use of the zabbix-api for automatically creating and or updating hosts. - -Host encryption configuration will be set to match agent configuration. - -When `zabbix_api_create_hostgroup` or `zabbix_api_create_hosts` is set to `True`, it will install on the host executing the Ansible playbook the `zabbix-api` python module. - -* `zabbix_url`: The url on which the Zabbix webpage is available. Example: http://zabbix.example.com - -* `zabbix_api_http_user`: The http user to access zabbix url with Basic Auth -* `zabbix_api_http_password`: The http password to access zabbix url with Basic Auth - -* `zabbix_api_create_hosts`: When you want to enable the Zabbix API to create/delete the host. This has to be set to `True` if you want to make use of `zabbix_create_host`. Default: `False` - -* `zabbix_api_create_hostgroup`: When you want to enable the Zabbix API to create/delete the hostgroups. This has to be set to `True` if you want to make use of `zabbix_create_hostgroup`.Default: `False` - -* `zabbix_api_user`: Username of user which has API access. - -* `zabbix_api_pass`: Password for the user which has API access. - -* `zabbix_create_hostgroup`: present (Default) if the hostgroup needs to be created or absent if you want to delete it. This only works when `zabbix_api_create_hostgroup` is set to `True`. - -* `zabbix_host_status`: enabled (Default) when host in monitored, disabled when host is disabled for monitoring. - -* `zabbix_create_host`: present (Default) if the host needs to be created or absent is you want to delete it. This only works when `zabbix_api_create_hosts` is set to `True`. - -* `zabbix_update_host`: yes (Default) if the host should be updated if already present. This only works when `zabbix_api_create_hosts` is set to `True`. - -* `zabbix_useuip`: 1 if connection to zabbix-agent is made via ip, 0 for fqdn. - -* `zabbix_host_groups`: A list of hostgroups which this host belongs to. - -* `zabbix_link_templates`: A list of templates which needs to be link to this host. The templates should exist. - -* `zabbix_macros`: A list with macro_key and macro_value for creating hostmacro's. - -* `zabbix_inventory_mode`: Configure Zabbix inventory mode. Needed for building inventory data, manually when configuring a host or automatically by using some automatic population options. This has to be set to `automatic` if you want to make automatically building inventory data. - -* `zabbix_visible_hostname` : Configure Zabbix visible name inside Zabbix web UI for the node. - -* `zabbix_validate_certs` : yes (Default) if we need to validate tls certificates of the API. Use `no` in case self-signed certificates are used - -## Windows Variables - -**NOTE** - -_Supporting Windows is a best effort (I don't have the possibility to either test/verify changes on the various amount of available Windows instances). PRs specific to Windows will almost immediately be merged, unless someone is able to provide a Windows test mechanism via Travis for Pull Requests._ - -* `zabbix_version_long`: The long (major.minor.patch) version of the Zabbix Agent. This will be used to generate the `zabbix_win_download_link` link and for Zabbix Agent update if `zabbix_agent_package_state: latest`. - -* `zabbix_win_download_link`: The download url to the `win.zip` file. - -* `zabbix_win_install_dir`: The directory where Zabbix needs to be installed. - -* `zabbix_agent_win_logfile`: The full path to the logfile for the Zabbix Agent. - -* `zabbix_agent_win_include`: The directory in which the Zabbix specific configuration files are stored. - -* `zabbix_agent_win_svc_recovery`: Enable Zabbix Agent service auto-recovery settings. - -## macOS Variables - -* `zabbix_version_long`: The long (major.minor.patch) version of the Zabbix Agent. This will be used to generate the `zabbix_mac_download_link` link. - -* `zabbix_mac_download_link`: The download url to the `pkg` file. - -## Docker Variables - -When you don't want to install the Zabbix Agent on the host, but would like to run it in a container then these properties are useful. When `zabbix_agent_docker` is set to `True`, then a -Docker image will be downloaded and a Container will be started. No other installations will be done on the host, with the exception of the PSK file and the "Zabbix Include Directory". - -The following directories are mounted in the Container: - -``` - - /etc/zabbix/zabbix_agentd.d:/etc/zabbix/zabbix_agentd.d - - /:/hostfs:ro - - /etc:/hostfs/etc:ro - - /proc:/hostfs/proc:ro - - /sys:/hostfs/sys:ro - - /var/run:/var/run -``` - -Keep in mind that using the Zabbix Agent in a Container requires changes to the Zabbix Template for Linux as `/proc`, `/sys` and `/etc` are mounted in a directory `/hostfs`. - -* `zabbix_agent_docker`: When set to `True`, it will install a Docker container on the target host instead of installation on the target. Default: `False` - -* `zabbix_agent_docker_state`: Default: `started` - -* `zabbix_agent_docker_name`: The name of the Container. Default: `zabbix-agent` - -* `zabbix_agent_docker_image`: The name of the Docker image. Default: `zabbix/zabbix-agent` - -* `zabbix_agent_docker_image_tag`: The tag of the Docker image. - -* `zabbix_agent_docker_user_gid`: The group id of the zabbix user in the Container. - -* `zabbix_agent_docker_user_uid`: The user id of the zabbix user in the Container. - -* `zabbix_agent_docker_network_mode`: The name of the (Docker) network that should be used for the Container. Default `host`. - -* `zabbix_agent_docker_restart_policy`: The restart policy of the Container. Default: `unless-stopped` - -* `zabbix_agent_docker_privileged`: When set to `True`, the container is running in privileged mode. - -* `zabbix_agent_docker_ports`: A list with `:` values to open ports to the container. - -* `zabbix_agent_docker_security_opts`: A list with available security options. - -* `zabbix_agent_docker_volumes`: A list with all directories that needs to be available in the Container. - -* `zabbix_agent_docker_env`: A dict with all environment variables that needs to be set for the Container. - -## Other variables - -* `zabbix_agent_firewall_enable`: If IPtables needs to be updated by opening an TCP port for port configured in `zabbix_agent_listenport`. - -* `zabbix_agent_firewall_source`: When provided, IPtables will be configuring to only allow traffic from this IP address/range. - -* `zabbix_agent_firewalld_enable`: If firewalld needs to be updated by opening an TCP port for port configured in `zabbix_agent_listenport` and `zabbix_agent_jmx_listenport` if defined. - -* `zabbix_agent_firewalld_source`: When provided, firewalld will be configuring to only allow traffic for IP configured in `zabbix_agent_server`. - -* `zabbix_agent_firewalld_zone`: When provided, the firewalld rule will be attached to this zone (only if zabbix_agent_firewalld_enable is set to true). The default behavior is to use the default zone define by the remote host firewalld configuration. - -* `zabbix_agent_firewall_action`: When to `insert` the rule or to `append` to IPTables. Default: `insert`. - -* `zabbix_agent_firewall_chain`: Which `chain` to add the rule to IPTables. Default `INPUT` - -* `zabbix_agent_description`: Description of the host in Zabbix. - -* `zabbix_agent_inventory_zabbix`: Adds Facts for a zabbix inventory - -## IPMI variables - -* `zabbix_agent_ipmi_authtype`: IPMI authentication algorithm. Possible values are 1 (callback), 2 (user), 3 (operator), 4 (admin), 5 (OEM), with 2 being the API default. - -* `zabbix_agent_ipmi_password`: IPMI password. - -* `zabbix_agent_ipmi_privilege`: IPMI privilege level. Possible values are 1 (callback), 2 (user), 3 (operator), 4 (admin), 5 (OEM), with 2 being the API default. - -* `zabbix_agent_ipmi_username`: IPMI username. - -## proxy - -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: - -* `zabbix_http_proxy` -* `zabbix_https_proxy` - -# Dependencies - -There are no dependencies on other roles. - -# Example Playbook - -## agent_interfaces - -This will configure the Zabbix Agent interface on the host. -``` -zabbix_agent_interfaces: - - type: 1 - main: 1 - useip: "{{ zabbix_useuip }}" - ip: "{{ zabbix_agent_ip }}" - dns: "{{ ansible_fqdn }}" - port: "{{ zabbix_agent_listenport }}" -``` - -## Other interfaces - -You can also configure the `zabbix_agent_interfaces` to add/configure snmp, jmx and ipmi interfaces. - -You'll have to use one of the following type numbers when configuring it: - -| Type Interface | Nr | -|-----------------|-------| -| Zabbix Agent | 1 | -| snmp | 2 | -| ipmi | 3 | -| jmx | 4 | - -Configuring a snmp interface will look like this: - -``` -zabbix_agent_interfaces: - - type: 2 - main: 1 - useip: "{{ zabbix_useuip }}" - ip: "{{ agent_ip }}" - dns: "{{ ansible_fqdn }}" - port: "{{ agent_listenport }}" -``` - -## Vars in role configuration -Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: - - - hosts: all - roles: - - role: dj-wasabi.zabbix-agent - zabbix_agent_server: 192.168.33.30 - zabbix_agent_serveractive: 192.168.33.30 - zabbix_url: http://zabbix.example.com - zabbix_api_use: true # use zabbix_api_create_hosts and/or zabbix_api_create_hostgroup from 0.8.0 - zabbix_api_user: Admin - zabbix_api_pass: zabbix - zabbix_create_host: present - zabbix_host_groups: - - Linux Servers - zabbix_link_templates: - - Template OS Linux - - Apache APP Template - zabbix_macros: - - macro_key: apache_type - macro_value: reverse_proxy - -## Combination of group_vars and playbook -You can also use the group_vars or the host_vars files for setting the variables needed for this role. File you should change: `group_vars/all` or `host_vars/` (Where is the hostname of the machine running Zabbix Server) - - zabbix_agent_server: 192.168.33.30 - zabbix_agent_serveractive: 192.168.33.30 - zabbix_url: http://zabbix.example.com - zabbix_api_use: true # use zabbix_api_create_hosts and/or zabbix_api_create_hostgroup from 0.8.0 - zabbix_api_user: Admin - zabbix_api_pass: zabbix - zabbix_create_host: present - zabbix_host_groups: - - Linux Servers - zabbix_link_templates: - - Template OS Linux - - Apache APP Template - zabbix_macros: - - macro_key: apache_type - macro_value: reverse_proxy - -and in the playbook only specifying: - - - hosts: all - roles: - - role: dj-wasabi.zabbix-agent - -## Example for TLS PSK encrypted agent communication - -Variables e.g. in the playbook or in `host_vars/myhost`: - - zabbix_agent_tlsaccept: psk - zabbix_agent_tlsconnect: psk - zabbix_agent_tlspskidentity: "myhost PSK" - zabbix_agent_tlspsk_secret: b7e3d380b9d400676d47198ecf3592ccd4795a59668aa2ade29f0003abbbd40d - zabbix_agent_tlspskfile: /etc/zabbix/zabbix_agent_pskfile.psk - -# Molecule - -This role is configured to be tested with Molecule. You can find on this page some more information regarding Molecule: https://werner-dijkerman.nl/2016/07/10/testing-ansible-roles-with-molecule-testinfra-and-docker/ - -With each Pull Request, Molecule will be executed via travis.ci. Pull Requests will only be merged once these tests run successfully. - -There are 2 scenarios that are executed with Travis. - -## default - -With the first scenario, Molecule will boot 5 Docker containers with the following OS'es: - -* Debian 8 -* CentOS 7 -* Ubuntu 16.04 -* Ubuntu 18.04 -* Mint - -This scenario will be doing a basic installation/configuration, without registering the host via the Zabbix API to the server. - -## with-server - -The 2nd scenario will boot 4 Docker containers with the following OS'es: - -* CentOS 7 (Zabbix Server) -* Debian 8 -* CentOS 7 -* Ubuntu 18.04 - -First, a Zabbix Server will be installed on a container. This installation make uses of other dj-wasabi roles to install/configure a Zabbix Server. Once this instance is running, the 3 other agents are installed. - -Each host will register itself on the Zabbix Server and the status should be 0 (This means the Zabbix Server and Zabbix Agent are connected). - -The Ubuntu agent will register itself via a PSK, so that communication between the Zabbix Server and Zabbix Agent is encrypted with e Pre-Shared Key. - -## before-last-version - -The 3rd and last scenario is the `before-last-version`. This is the same scenario like the `default`, but uses the previous Zabbix version. - -# Deploying Userparameters - -The following steps are required to install custom userparameters and/or scripts: - -* Put the desired userparameter file in the `templates/userparameters` directory and name it as `.j2`. For example: `templates/userparameters/mysql.j2`. You can change the default directory to a custom one modifying `zabbix_agent_userparameters_templates_src` variable. -* Put the scripts directory (if any) in the `files/scripts` directory. For example: `files/scripts/mysql`. You can change the default directory to a custom one modifying `zabbix_agent_userparameters_scripts_src` variable. -* Add `zabbix_agent_userparameters` variable to the playbook as a list of dictionaries and define userparameter name and scripts directory name (if there are no scripts just no not specify the `scripts_dir` variable). - -Example: - -``` -- hosts: mysql_servers - tasks: - - include_role: - name: dj-wasabi.zabbix-agent - vars: - zabbix_agent_server: zabbix.mydomain.com - zabbix_agent_userparameters: - - name: mysql - scripts_dir: mysql - - name: galera - -``` - -Example of the "templates/userparameters/mysql.j2" file: - -``` -UserParameter=mysql.ping_to,mysqladmin -uroot ping | grep -c alive -``` - -# License - -MIT - -# Author Information - -Please send suggestion or pull requests to make this role better. Also let me know if you encounter any issues installing or using this role. - -Github: https://github.com/dj-wasabi/ansible-zabbix-agent - -mail: ikben [ at ] werner-dijkerman . nl diff --git a/roles/zabbix_agent/README.md b/roles/zabbix_agent/README.md new file mode 120000 index 000000000..d77fcc551 --- /dev/null +++ b/roles/zabbix_agent/README.md @@ -0,0 +1 @@ +../../docs/ZABBIX_AGENT_ROLE.md \ No newline at end of file diff --git a/roles/zabbix_agent/setup.cfg b/roles/zabbix_agent/setup.cfg deleted file mode 100644 index 1fd489337..000000000 --- a/roles/zabbix_agent/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -max-line-length = 160 diff --git a/roles/zabbix_agent/upgrade.md b/roles/zabbix_agent/upgrade.md deleted file mode 100644 index b257082e8..000000000 --- a/roles/zabbix_agent/upgrade.md +++ /dev/null @@ -1,11 +0,0 @@ -# Upgrade - -## 1.0.0 - -With this 1.0.0 release, the following is changed: - -* All configuration properties starts with `zabbix_` now. Example, property named `agent_tlsaccept` is now `zabbix_agent_tlsaccept`. - -## 0.8.0 - -As of version 0.8.0, the property `zabbix_api_use` isn't available anymore. It is replaced by the properties `zabbix_api_create_hostgroup` and `zabbix_api_create_hosts` diff --git a/roles/zabbix_javagateway/README.md b/roles/zabbix_javagateway/README.md deleted file mode 100644 index 34714da9b..000000000 --- a/roles/zabbix_javagateway/README.md +++ /dev/null @@ -1,69 +0,0 @@ -dj-wasabi.zabbix-javagateway -========= - -This role is migrated to: https://github.com/ansible-collections/community.zabbix/ -In this repository, a read only version is/will be available for those who can not make use of collections (yet). Changes/updates will only be applied to the collection and not in this repository. - -Requirements ------------- - -This role will work on: - -* Red Hat -* Debian -* Ubuntu - -So, you'll need one of those operating systems.. :-) - -Role Variables --------------- - -There are some variables in de default/main.yml which can (Or needs to) be changed/overriden: - -* `zabbix_version`: This is the version of zabbix. Default it is 2.4, but can be overriden to 2.2 or 2.0. - -* `zabbix_repo`: True / False. When you already have an repository with the zabbix components, you can set it to False. - -Dependencies ------------- - -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. - -When using the zabbix-server: -``` - roles: - - { role: dj-wasabi.zabbix-server, zabbix_server_javagateway: 192.168.1.2} -``` - -or when using the zabbix-proxy: -``` - roles: - - { role: dj-wasabi.zabbix-proxy, zabbix_server_host: 192.168.1.1, zabbix_proxy_javagateway: 192.168.1.2} -``` - -The above is assumed you'll using the 'dj-wasabi' zabbix roles. Don't know how to do this with other zabbix-server (or zabbix-proxy) roles from other members. - -Example Playbook ----------------- - -Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: - - - hosts: zabbix-server - sudo: yes - roles: - - { role: dj-wasabi.zabbix-server, zabbix_server_javagateway: 192.168.1.2} - - { role: dj-wasabi.zabbix-javagateway } - -License -------- - -GPLv3 - -Author Information ------------------- - -This is my first attempt to create an ansible role, so please send suggestion or pull requests to make this role better. - -Github: https://github.com/dj-wasabi/ansible-zabbix-proxy - -mail: ikben [ at ] werner-dijkerman . nl diff --git a/roles/zabbix_javagateway/README.md b/roles/zabbix_javagateway/README.md new file mode 120000 index 000000000..06bb75ed6 --- /dev/null +++ b/roles/zabbix_javagateway/README.md @@ -0,0 +1 @@ +../../docs/ZABBIX_JAVAGATEWAY_ROLE.md \ No newline at end of file diff --git a/roles/zabbix_javagateway/setup.cfg b/roles/zabbix_javagateway/setup.cfg deleted file mode 100644 index 1fd489337..000000000 --- a/roles/zabbix_javagateway/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -max-line-length = 160 diff --git a/roles/zabbix_proxy/CHANGELOG.md b/roles/zabbix_proxy/CHANGELOG.md deleted file mode 100644 index ff07038cf..000000000 --- a/roles/zabbix_proxy/CHANGELOG.md +++ /dev/null @@ -1,105 +0,0 @@ -# ansible-zabbix-server Release - -Below an overview of all changes in the releases. - -Version (Release date) - -FINAL and LAST release for this role in this repository. This role will be transferred to: https://github.com/ansible-collections/community.zabbix/ - -1.7.0 (2020-05-23) - - * Added zabbix_proxy_enableremotecommands variable #57 (By pull request: AleksejsC (Thanks!)) - * Added variable for specifying version Zabbix proxy #58 (By pull request: dmitriy-kharchenko (Thanks!)) - * implement a condition on the SocketDir parameter #59 (By pull request: v (Thanks!)) - * HostnameItem can be set and Hostname is now optional #61 (By pull request: sebedh (Thanks!)) - * Add Proxy creation on through API #62 (By pull request: SimBou (Thanks!)) - * Use the correct naming as suggested in dj-wasabi/ansible-zabbix-agent #301 #63 - * fix SELinux issue : preprocessing.sock permission denied #64 (By pull request: SimBou (Thanks!)) - * ability to manage zabbix-proxy service #65 (By pull request: Vinclame (Thanks!)) - -1.6.0 (2019-12-01) - - * Added missing "become: yes" statements in tasks/main.yml Redhat.yml #53 (By pull request: elcomtik (Thanks!)) - * SocketDir missing in zabbix_proxy.conf #54 (By pull request: Vinclame (Thanks!)) - * selinux blocks preprocessing workers #55 (By pull request: Vinclame (Thanks!)) - * Update to 4.4 #56 (By pull request: macaddict89 (Thanks!)) - -1.5.0 (2019-09-27) - - * Fix and refactor SELinux support #47 (By pull request: angystardust (Thanks!)) - * Update Debian.yml #49 (By pull request: giedriusramas (Thanks!)) - * Calling yum and apt using a loop is deprecated #50 (By pull request: Aversiste (Thanks!)) - * fixing issue 48 #51 (By pull request: bbcnt (Thanks!)) - * change default version #52 (By pull request: fabtho (Thanks!)) - -1.4.0 (2019-04-15) - - * Added property zabbix_proxy_package_state #45 - * Fixed some Ansible Lint issues #46 - * bugfix: "zabbix_proxy_tlspskfile" was not created with content "zabbi… #39 (By pull request: menzelit (Thanks!)) - * Updated to Zabbix 4.2 #41 - * enable upgrade of an existing installation #42 (By pull request: zab35 (Thanks!)) - -1.3.0 (2019-01-25) - - * Added retries for packages installation #38 - * Adding zabbix_proxy_install_database_client variable #37 (By pull request: rnsc (Thanks!)) - -1.2.0 (2018-10-19) - - * Make it work with Zabbix 4.0 - -1.1.0 (2018-06-23) - - * typo in zabbix_proxy_cachesize variable #32 (By pull request: q1x (Thanks!)) - * Updated minimal Ansible version to 2.4 #28 - * Add support for Debian 9 #28 - * Fix for: Mysql database error #21 - * Various fixes #26 (By pull request: hatifnatt (Thanks!)) - * fix DBPort parameter in config template #23 (By pull request: maxim0r (Thanks!)) - * Using correct compare #22 - * set selinux policy to permissive for zabbix_t, needed for CentOS and others #18 (By pull request: andrzejwp (Thanks!)) - * Add TLS connection configuration #17 (By pull request: mgornikov (Thanks!)) - * Add support for sqlite3 DB #16 (By pull request: mgornikov (Thanks!)) - -1.0.0 (2017-09-10) - - * Changed from ini to yml style - * Replace shell tasks with modules. - * Installing default 3.4. - * Prefixed all properties that started with `proxy_` with the value `zabbix_`. - * Added upgrade part in documentation. - -0.5.0 (2017-07-17) - - * Renaming docker-py to docker #10 - * [!] fix misspelling with property ListenIP #9 (By pull request: lebe-dev (Thanks!)) - * Add Amazon Linux support #7 (By pull request: kostyrev (Thanks!)) - * Add HistoryIndexCacheSize for zabbix 3.2 #6 (By pull request: kostyrev (Thanks!)) - * Molecule test #5 - * Fix bugs with LoadModule & add sqlite3 support #2 (By pull request: splitice (Thanks!)) - * Zabbix proxy 3.0 fixes #1 (By pull request: zbal (Thanks!)) - -0.4.0 (2016-08-24) - - * ? - -0.3.0 (2016-02-08) - - * Added test-kitchen tests - * Small bug fix for installation on RedHat/Debian - -0.2.0 (2016-02-04) - - * Added travis-ci test. - -0.1.0 (2015-02-01) - - * Updated readme - * added double quotes on names - * added var zabbix_repo - * added var for database creation and load file - -0.0.1 (2014-10-31) - - * Initial Creation diff --git a/roles/zabbix_proxy/CODE_OF_CONDUCT.md b/roles/zabbix_proxy/CODE_OF_CONDUCT.md deleted file mode 100644 index e28ac17f7..000000000 --- a/roles/zabbix_proxy/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,3 +0,0 @@ -# Code of Conduct - -The Code of Conduct from Ansible found [here](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html) applies to this Ansible role as well. diff --git a/roles/zabbix_proxy/CONTRIBUTING.md b/roles/zabbix_proxy/CONTRIBUTING.md deleted file mode 100644 index 4b8af3768..000000000 --- a/roles/zabbix_proxy/CONTRIBUTING.md +++ /dev/null @@ -1,88 +0,0 @@ -# Contributing to this role - -**Table of content** - -- [Contributing to this role](#contributing-to-this-role) - * [Contributing](#contributing) - * [(local) Development](#-local--development) - + [Requirements](#requirements) - + [Execution](#execution) -- [Other](#other) - * [Virtualenv](#virtualenv) - * [Links](#links) - -Thank you very much for making time to improve this Ansible role. - -## Contributing - -Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. [Contributor Code of Conduct](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html). - -1. Fork the repo - -2. Create a branch and apply your changes to this branch. - - a. Make sure you have updated the documentation when adding new variables; - - b. Don't forget to add/update tests so we can test the functionality during each Pull Request; - - c. Make sure the tests will succeed. - -3. Push the branch to your fork and submit a pull request. - -**Note** - -Pull Requests that fails during the tests will not be merged. - -## Coding Guidelines - -Style guides are important because they ensure consistency in the content, look, and feel of a book or a website. - -* [Ansible Style Guide](http://docs.ansible.com/ansible/latest/dev_guide/style_guide/) -* It's "Ansible" when referring to the product and ``ansible`` when referring to the command line tool, package, etc -* Playbooks should be written in multi-line YAML with ``key: value``. The form ``key=value`` is only for ``ansible`` ad-hoc, not for ``ansible-playbook``. -* Tasks should always have a ``name:`` - -## (local) Development - -This role make use of Molecule to test the execution of the role and verificate it. In the root of the repository, a file named `requirements.txt` exists and contains the versions used by the tests. - -### Requirements - -You can install them with the following command: - -``` -pip install -r requirements.txt -``` - -Once the dependencies are installed, please install Docker as Molecule is configured in this repository to create Docker containers. See [this](https://docs.docker.com/install/) link to install Docker on your system. - -### Execution - -Once everything is installed, you can validate your changes by executing: -``` -molecule test -``` - -It should run without any issues. - -# Other - -## Virtualenv - -Suggestion is to create a virtualenv so you won't have issues with other projects. - -Some web pages describing for virtual env: - -* http://thepythonguru.com/python-virtualenv-guide/ -* https://realpython.com/python-virtual-environments-a-primer/ -* https://www.dabapps.com/blog/introduction-to-pip-and-virtualenv-python/ - -## Links - -[Molecule](https://molecule.readthedocs.io/) - -[Ansible](https://www.ansible.com/) - -[Molecule V2 with your own role](https://werner-dijkerman.nl/2017/09/05/using-molecule-v2-to-test-ansible-roles/) - -**End note**: Have fun making changes. If a feature helps you, then others find it helpful too and I will happily have it merged. diff --git a/roles/zabbix_proxy/LICENSE b/roles/zabbix_proxy/LICENSE deleted file mode 100644 index 6922fb326..000000000 --- a/roles/zabbix_proxy/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Werner Dijkerman - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/roles/zabbix_proxy/PULL_REQUEST_TEMPLATE.md b/roles/zabbix_proxy/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 70c5edefc..000000000 --- a/roles/zabbix_proxy/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,12 +0,0 @@ -**Description of PR** - - -**Type of change** - - -Feature Pull Request -Bugfix Pull Request -Docs Pull Request - -**Fixes an issue** - diff --git a/roles/zabbix_proxy/README.md b/roles/zabbix_proxy/README.md deleted file mode 100644 index 5b9561573..000000000 --- a/roles/zabbix_proxy/README.md +++ /dev/null @@ -1,257 +0,0 @@ -Table of Content - -- [Overview](#overview) -- [Upgrades](#upgrades) - * [1.0.0](#100) - * [Operating systems](#operating-systems) - * [Zabbix Versions](#zabbix-versions) - + [Zabbix 4.2](#zabbix-42) - + [Zabbix 4.0](#zabbix-40) - + [Zabbix 3.4](#zabbix-34) - + [Zabbix 3.2](#zabbix-32) - + [Zabbix 3.0](#zabbix-30) - + [Zabbix 2.4](#zabbix-24) - + [Zabbix 2.2](#zabbix-22) -- [Role Variables](#role-variables) -- [Dependencies](#dependencies) -- [Example Playbook](#example-playbook) -- [License](#license) -- [Author Information](#author-information) - - -[![Build Status](https://travis-ci.org/dj-wasabi/ansible-zabbix-proxy.svg?branch=master)](https://travis-ci.org/dj-wasabi/ansible-zabbix-proxy) - -# Overview - -This role is migrated to: https://github.com/ansible-collections/community.zabbix/ -In this repository, a read only version is/will be available for those who can not make use of collections (yet). Changes/updates will only be applied to the collection and not in this repository. - -# Upgrades - -## 1.0.0 - -With this 1.0.0 release, the following is changed: - -* All properties starts with `zabbix_` now. Example, property named `proxy_dbhost` is now `zabbix_proxy_dbhost`. - -## Operating systems - -This role will work on the following operating systems: - - * Red Hat - * Debian - * Ubuntu - -So, you'll need one of those operating systems.. :-) -Please sent Pull Requests or suggestions when you want to use this role for other Operating systems. - -## Zabbix Versions - -See the following list of supported Operating systems with the Zabbix releases. - -### Zabbix 4.4 - - * CentOS 7.x, 8.x - * Amazon 7.x - * RedHat 7.x, 8.x - * OracleLinux 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 - * RedHat 7.x - * OracleLinux 7.x - * Scientific Linux 7.x - * Ubuntu 14.04, 16.04, 18.04 - * Debian 8, 9 - -### Zabbix 4.0 - - * CentOS 7.x - * Amazon 7.x - * RedHat 7.x - * OracleLinux 7.x - * Scientific Linux 7.x - * Ubuntu 14.04, 16.04, 18.04 - * Debian 8, 9 - -### Zabbix 3.4 - - * CentOS 7.x - * Amazon 7.x - * RedHat 7.x - * OracleLinux 7.x - * Scientific Linux 7.x - * Ubuntu 14.04, 16.04 - * Debian 7, 8, 9 - -### Zabbix 3.2 - - * CentOS 7.x - * Amazon 7.x - * RedHat 7.x - * OracleLinux 7.x - * Scientific Linux 7.x - * Ubuntu 14.04, 16.04 - * Debian 7, 8 - -### Zabbix 3.0 - - * CentOS 5.x, 6.x, 7.x - * Amazon 5.x, 6.x, 7.x - * RedHat 5.x, 6.x, 7.x - * OracleLinux 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 - * RedHat 6.x, 7.x - * OracleLinux 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 - * RedHat 5.x, 6.x - * OracleLinux 5.x, 6.x - * Scientific Linux 5.x, 6.x - * Ubuntu 12.04 - * Debian 7 - -# Role Variables - -## Main variables - -There are some variables in de default/main.yml which can (Or needs to) be changed/overriden: - -* `zabbix_server_host`: The ip or dns name for the zabbix-server machine. - -* `zabbix_server_port`: The port on which the zabbix-server is running. Default: 10051 - -* `zabbix_version`: This is the version of zabbix. Default it is 4.2, but can be overriden to 4.0/3.4/3.2/3.0/2.4/2.2. - -* `zabbix_proxy_{rhel,debian,ubuntu}_version`: This is the version of zabbix proxy. For example 4.4.4/4.2.5/4.2.8 - -* `zabbix_repo`: True / False. When you already have an repository with the zabbix components, you can set it to False. - -* `*zabbix_proxy_package_state`: Default: _present_. Can be overridden to "latest" to update packages when needed. - -* `zabbix_proxy_install_database_client`: True / False. False does not install database client. Default: True. - -* `zabbix_agent_become_on_localhost`: Set to `False` if you don't need to elevate privileges on localhost to install packages locally with pip. Default: True - -* `zabbix_proxy_manage_service`: True / False. When you run multiple Zabbix proxies in a High Available cluster setup (e.g. pacemaker), you don't want Ansible to manage the zabbix-proxy service, because Pacemaker is in control of zabbix-proxy service. - -* `zabbix_install_pip_packages`: Set to `False` if you don't want to install the required pip packages. Useful when you control your environment completely. Default: True - -There are some zabbix-proxy specific variables which will be used for the zabbix-proxy configuration file, these can be found in the default/main.yml file. There are 2 which needs some explanation: - -```bash - #zabbix_proxy_database: mysql - #zabbix_proxy_database_long: mysql - #zabbix_proxy_database: sqlite3 - #zabbix_proxy_database_long: sqlite3 - zabbix_proxy_database: pgsql - zabbix_proxy_database_long: postgresql -``` - -There are 3 database_types which will be supported: mysql/postgresql and sqlite. You'll need to comment or uncomment the database you would like to use. In example from above, the postgresql database is used. If you want to use mysql, uncomment the 2 lines from mysql and comment the 2 lines for postgresql. - -If you use mysql, then you should define mysql username, password and host to prepare zabbix database, otherwise they will be considered as their default value (and therefor, connecting to database will be considered as connecting to localhost with no password). the keys are belows: - zabbix_proxy_mysql_login_host - zabbix_proxy_mysql_login_user - zabbix_proxy_mysql_login_password - -## TLS Specific configuration - -These variables are specific for Zabbix 3.0 and higher: - -* `*zabbix_proxy_tlsconnect`: How the proxy should connect to server or proxy. Used for active checks. - - Possible values: - - * no_encryption - * PSK - * certificate - -* `*zabbix_proxy_tlsaccept`: What incoming connections to accept. - - Possible values: - - * no_encryption - * PSK - * certificate - -* `*zabbix_proxy_tlscafile`: Full pathname of a file containing the top-level CA(s) certificates for peer certificate verification. - -* `*zabbix_proxy_tlscrlfile`: Full pathname of a file containing revoked certificates. - -* `*zabbix_proxy_tlsservercertissuer`: Allowed server certificate issuer. - -* `*zabbix_proxy_tlsservercertsubject`: Allowed server certificate subject. - -* `*zabbix_proxy_tlscertfile`: Full pathname of a file containing the agent certificate or certificate chain. - -* `*zabbix_proxy_tlskeyfile`: Full pathname of a file containing the agent private key. - -* `*zabbix_proxy_tlspskidentity`: Unique, case sensitive string used to identify the pre-shared key. - -## Zabbix API variables - -These variables need to be overridden when you want to make use of the zabbix-api for automatically creating and or updating hosts. - -Host encryption configuration will be set to match agent configuration. - -When `zabbix_api_create_proxy` is set to `True`, it will install on the host executing the Ansible playbook the `zabbix-api` python module. - -* `zabbix_url`: The url on which the Zabbix webpage is available. Example: http://zabbix.example.com - -* `zabbix_api_http_user`: The http user to access zabbix url with Basic Auth -* `zabbix_api_http_password`: The http password to access zabbix url with Basic Auth - -* `zabbix_api_create_proxy`: When you want to enable the Zabbix API to create/delete the proxy. This has to be set to `True` if you want to make use of `zabbix_create_proxy`. Default: `False` - -* `zabbix_api_user`: Username of user which has API access. - -* `zabbix_api_pass`: Password for the user which has API access. - -* `zabbix_create_proxy`: present (Default) if the proxy needs to be created or absent if you want to delete it. This only works when `zabbix_api_create_proxy` is set to `True`. - -* `zabbix_proxy_status`: active (Default) if the proxy needs to be active or passive. - -# Dependencies - -```text -You'll need to find the correct database role by yourself. I only want to use roles which supports the 3 main operating systems as well and for now I can't find one. If there is an role which supports these 3 operating systems, please let me know and I'll use it as dependency. -``` - -# Example Playbook - -Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: - - - 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 to create an ansible role, so please send suggestion or pull requests to make this role better. - -Github: https://github.com/dj-wasabi/ansible-zabbix-proxy - -mail: ikben [ at ] werner-dijkerman . nl diff --git a/roles/zabbix_proxy/README.md b/roles/zabbix_proxy/README.md new file mode 120000 index 000000000..b71abbb08 --- /dev/null +++ b/roles/zabbix_proxy/README.md @@ -0,0 +1 @@ +../../docs/ZABBIX_PROXY_ROLE.md \ No newline at end of file diff --git a/roles/zabbix_server/CHANGELOG.md b/roles/zabbix_server/CHANGELOG.md deleted file mode 100644 index f63de6d3f..000000000 --- a/roles/zabbix_server/CHANGELOG.md +++ /dev/null @@ -1,177 +0,0 @@ -# ansible-zabbix-server Release - -Below an overview of all changes in the releases. - -Version (Release date) - -FINAL and LAST release for this role in this repository. This role will be transferred to: https://github.com/ansible-collections/community.zabbix/ - -1.8.0 (2020-05-23) - - * allow remote login to db server from zabbix server #166 (By pull request: Vinclame (Thanks!)) - * Improving readability #167 (By pull request: santiagomr (Thanks!)) - * delegated_dbhost create/import tasks was missing create.sql file. #168 (By pull request: Vinclame (Thanks!)) - * zabbix_database_sqlload variable README fix #171 (By pull request: bdekker-routit (Thanks!)) - * Avoid conflicts with zabbix_version var #172 (By pull request: santiagomr (Thanks!)) - * make zabbix service start/enable optional #174 (By pull request: tenhishadow (Thanks!)) - * Add SELinux workaround #175 (By pull request: SimBou (Thanks!)) - * Use the correct naming as suggested in dj-wasabi/ansible-zabbix-agent #301 #176 - * fix issue with datafiles_path on RHEL8 #177 (By pull request: SimBou (Thanks!)) - * Fix check_mode for dpkg_exclude_line.rc on Debian/Ubuntu (Closes: #179) #180 (By pull request: kr4ut (Thanks!)) - * ability to manage zabbix-server service #181 (By pull request: Vinclame (Thanks!)) - -1.7.0 (2019-12-01) - - * Using the correct properties in examples #159 - * Updating to Zabbix 4.4 #160 - * Trying to use a Matrix in Travis and see what happens.. :-) #161 - * Added RHEL8 specific stuff #162 (By pull request: bdekker-routit (Thanks!)) - * Replaced version_compare #164 (By pull request: m3t4Lm4n (Thanks!)) - -1.6.0 (2019-09-27) - - * Install Python bindings based on interpreter; Closes dj-wasabi/ansible-zabbix-server#148 #149 (By pull request: kr4ut (Thanks!)) - * Update zabbix_server.conf.j2 #153 (By pull request: Grzyboll (Thanks!)) - * Fixed installation on Debian 10 (buster) #156 (By pull request: banzayats (Thanks!)) - * Workaround for importing create.sql.gz issue on Debian 10 #157 (By pull request: banzayats (Thanks!)) - -1.5.0 (2019-04-14) - - * docs: fix basic grammar mistakes #131 (By pull request: mirmire (Thanks!)) - * fix deprecation warning in ansible 2.4 #132 (By pull request: bessonovevgen (Thanks!)) - * Add Alertscript and Externalscript install #133 (By pull request: gmcgilvray (Thanks!)) - * modified placement of seboolean variables #135 (By pull request: average-joe (Thanks!)) - * fix installation when zabbix_repo="other" #136 (By pull request: wschaft (Thanks!)) - * alertscripts-fix #137 (By pull request: gmcgilvray (Thanks!)) - * Added retries for package installations #139 - * [E204] Lines should be no longer than 120 chars #140 - * Update README.md #141 (By pull request: mklvr (Thanks!)) - * Fix Zabbix installation on Bionic #142 (By pull request: logan2211 (Thanks!)) - * Fix typo on config #143 (By pull request: mrdumpty (Thanks!)) - * Updating to Zabbix 4.2 #145 - -1.4.0 (2018-11-23) - - * Fixes Deprecation Warnings for Ansible 2.7 to prepare.yml #121 (By pull request: borener (Thanks!)) - * Removes loops that are now causing Deprecation warnings in redhat.yml #122 (By pull request: borener (Thanks!)) - * Fix Deprecation warning associated with apt loops in Debian.yml #123 (By pull request: borener (Thanks!)) - * Make it a service only #124 - * Pre 4.0 config #125 (By pull request: Boolman (Thanks!)) - * Add install_recommends option to the apt-get install of zabbix-server #127 (By pull request: gmcgilvray (Thanks!)) - * Fix for: unable to install older releases of zabbix-server #129 - * Set the correct rights for configuration file #130 - -1.3.0 (2018-10-19) - - * Make it work with Zabbix 4.0 #112 - * added zabbix server package variable to upgrade packages when necessary #116 (By pull request: average-joe (Thanks!)) - * Changes to allow pgsql connection without ssh to remote db #111 (By pull request: ericsysmin (Thanks!)) - -1.2.0 (2018-09-11) - - * Added several files like license, code-of-conduct and contributing #92 - * added parameters to mysql_user task #95 (By pull request: average-joe (Thanks!)) - * Adding login parameters to database import task #103 (By pull request: rubentsirunyan (Thanks!)) - * Updated supported versions #104 (By pull request: dnmvisser (Thanks!)) - * Clarifying some stuff about dependencies #105 - * Reflect license change to MIT in README #107 (By pull request: stephankn (Thanks!)) - * Made some fixes specific to work with older Zabbix versions #108 - * Changes path to suggested in issue #109 - -1.1.0 (2018-05-20) - - * Use the service for ubuntu 14.04 - * Use the `zabbix_server_database` and `zabbix_server_database_long` as how it is documented - * Support Debian 9 - * Use Ansible 2.4 as minimum version - * Fixed/Removed some deprecation warnings - * Use specific version of libraries #87 - * Postgresql 10 support #73 (By pull request: eshikhov (Thanks!)) - * Update README.md #76 (By pull request: aminmaghsodi (Thanks!)) - * Update RedHat.yml #82 (By pull request: tshtilman (Thanks!)) - * Testing with Molecule V2 - -1.0.0 (2017-08-30) - - * From ini to yml style. - * Replace shell tasks with modules. - * Installing default 3.4. - * Prefixed all properties that started with `server_` with the value `zabbix_`. - * Added upgrade part in documentation. - * Documentation: Fix Formatting #71 (By pull request: fxfitz (Thanks!)) - * Fix permissions on Zabbix includedir #68 (By pull request: clement-lefevre (Thanks!)) - * Set Molecule to V1 for now since V2 is released. - -0.8.0 (2017-06-16) - - * Changed the dependency-definition to get rid of a deprecation warning #41 (By pull request: madonius (Thanks!)) - * Using a changed_when to fool ansible-lint #42 - * Create vhost config in correct directory and link to enable #47 (By pull request: stephankn (Thanks!)) - * Removing not needed ServerAlias entry #48 - * Updating when statement due to comment #50 - * Renaming docker-py to docker #54 - * skip steps related to zabbix-web package when not installing it #56 (By pull request: flyapen (Thanks!)) - * Fix for Wrong directory api instead of app in apache_vhost.conf.j2 #53 - -0.7.0 (2016-12-30) - - * Set up distributive-related config-ownership #40 (By pull request: envrm (Thanks!)) - * fix apache restart when using tag 'apache' … #39 (By pull request: lhoss (Thanks!)) - * debian/ubuntu: install postgresql-client pkg (instead of postgresql which contains the postgres server) #38 (By pull request: lhoss (Thanks!)) - * fix early failures when running the zabbix-server playbook in check-mode #37 (By pull request: lhoss (Thanks!)) - * Update main.yml #36 (By pull request: cognoscibilis (Thanks!)) - * Configurable zabbix server port and database port #34 (By pull request: vincepii (Thanks!)) - * debian and ubuntu repository install was generalized #32 (By pull request: matheuscunha (Thanks!)) - * Zabbix 3.2.0 - -0.6.0 (2016-08-24) - - * Removed Test Kitchen tests, added molecule tests - * Added collation and encoding for MySQL databases #23 - * Add SELinux specifics #19 (By pull request: mescanef (Thanks!)) - * Fixes in the README.md file #18 (By pull request: mescanef (Thanks!)) - * Fix for: zabbix_repo - inconsistent use between server and agent roles. #17 - * Fix for: apache 2.2. and 2.4 #15 - -0.5.1 (2016-04-03) - - * Fix for: zabbix_server.conf file mode #14 - * Fix for: Support for v3+ Server Configuration #13 - -0.5.0 (2016-03-28) - - * Zabbix 3.0 - * MySQL database creation on other host (delegation) - -0.4.0 (2016-02-05) - - * fix #2: server_dbhost allows for remote database but role does not fully support setting up on remote db #11 (By pull request: lhoss (Thanks!)) - * Added basic travis test - * Fixed installation on Debian / Ubuntu for installing mysqldb-python package. - -0.3.0 (2015-11-24) - - * Add test-kitchen #7 (By pull request: kostyrevaa (Thanks!)) - * Force apt cache update after installing Zabbix's gpg key #8 (By pull request: SAL-e (Thanks!)) - * tasks/mysql.yml - [add] install mysql client on RHEL base 7 #9 (By pull request: clopnis (Thanks!)) - * Updated test-kitchen tests - * Added BATS tests - * Added CHANGELOG.md file - -0.2.1 (2015-06-30) - - * Fix unzip schema files for RedHat #5 (By pull request: kostyrevaa (Thanks!)) - * Fix missed required space #6 (By pull request: kostyrevaa (Thanks!)) - -0.2.0 (2015-03-20) - - * Various fixes #3 (By pull request: srvg (Thanks!)) - * Add optional configuration for Apache virtualhost aliases #4 (By pull request: srvg (Thanks!)) - -0.1.0 (2015-02-01) - - * Two minor changes for installation #1 (By pull request: drmikecrowe (Thanks!)) - -0.0.1 (2014-10-31) - - * Initial creation \ No newline at end of file diff --git a/roles/zabbix_server/CODE_OF_CONDUCT.md b/roles/zabbix_server/CODE_OF_CONDUCT.md deleted file mode 100644 index e28ac17f7..000000000 --- a/roles/zabbix_server/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,3 +0,0 @@ -# Code of Conduct - -The Code of Conduct from Ansible found [here](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html) applies to this Ansible role as well. diff --git a/roles/zabbix_server/CONTRIBUTING.md b/roles/zabbix_server/CONTRIBUTING.md deleted file mode 100644 index c3107be31..000000000 --- a/roles/zabbix_server/CONTRIBUTING.md +++ /dev/null @@ -1,88 +0,0 @@ -# Contributing to this role - -**Table of content** - -- [Contributing to this role](#contributing-to-this-role) - * [Contributing](#contributing) - * [(local) Development](#-local--development) - + [Requirements](#requirements) - + [Execution](#execution) -- [Other](#other) - * [Virtualenv](#virtualenv) - * [Links](#links) - -Thank you very much for taking time to improve this Ansible role. - -## Contributing - -Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. [Contributor Code of Conduct](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html). - -1. Fork the repo - -2. Create a branch and apply your changes to this branch. - - a. Make sure you have updated the documentation when adding new variables; - - b. Don't forget to add/update tests so we can test the functionality during each Pull Request; - - c. Make sure the tests will succeed. - -3. Push the branch to your fork and submit a pull request. - -**Note** - -Pull Requests that fail during the tests will not be merged. - -## Coding Guidelines - -Style guides are important because they ensure consistency in the content, look, and feel of a book or a website. - -* [Ansible Style Guide](http://docs.ansible.com/ansible/latest/dev_guide/style_guide/) -* It's "Ansible" when referring to the product and ``ansible`` when referring to the command line tool, package, etc -* Playbooks should be written in multi-line YAML with ``key: value``. The form ``key=value`` is only for ``ansible`` ad-hoc, not for ``ansible-playbook``. -* Tasks should always have a ``name:`` - -## (local) Development - -This role makes use of Molecule to test the execution of the role and verify it. In the root of the repository, a file named `requirements.txt` exists and contains the versions used by the tests. - -### Requirements - -You can install them with the following command: - -``` -pip install -r requirements.txt -``` - -Once the dependencies are installed, please install Docker, as Molecule is configured in this repository to create Docker containers. See [this](https://docs.docker.com/install/) link to install Docker on your system. - -### Execution - -Once everything is installed, you can validate your changes by executing: -``` -molecule test -``` - -It should run without any issues. - -# Other - -## Virtualenv - -Suggestion is to create a virtualenv so you won't have issues with other projects. - -Some web pages describing for virtual env: - -* http://thepythonguru.com/python-virtualenv-guide/ -* https://realpython.com/python-virtual-environments-a-primer/ -* https://www.dabapps.com/blog/introduction-to-pip-and-virtualenv-python/ - -## Links - -[Molecule](https://molecule.readthedocs.io/) - -[Ansible](https://www.ansible.com/) - -[Molecule V2 with your own role](https://werner-dijkerman.nl/2017/09/05/using-molecule-v2-to-test-ansible-roles/) - -**End note**: Have fun making changes. If a feature helps you, then others find it helpful too and I will happily have it merged. diff --git a/roles/zabbix_server/LICENSE b/roles/zabbix_server/LICENSE deleted file mode 100644 index 6922fb326..000000000 --- a/roles/zabbix_server/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Werner Dijkerman - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/roles/zabbix_server/PULL_REQUEST_TEMPLATE.md b/roles/zabbix_server/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 70c5edefc..000000000 --- a/roles/zabbix_server/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,12 +0,0 @@ -**Description of PR** - - -**Type of change** - - -Feature Pull Request -Bugfix Pull Request -Docs Pull Request - -**Fixes an issue** - diff --git a/roles/zabbix_server/README.md b/roles/zabbix_server/README.md deleted file mode 100644 index 8daf1cb6f..000000000 --- a/roles/zabbix_server/README.md +++ /dev/null @@ -1,320 +0,0 @@ -Table of Contents - -- [Overview](#overview) -- [Upgrades](#upgrades) - * [1.0.0](#100) -- [Requirements](#requirements) - * [Operating systems](#operating-systems) - * [Zabbix Versions](#zabbix-versions) - + [Zabbix 4.4](#zabbix-44) - + [Zabbix 4.2](#zabbix-42) - + [Zabbix 4.0](#zabbix-40) - + [Zabbix 3.4](#zabbix-34) - + [Zabbix 3.2](#zabbix-32) - + [Zabbix 3.0](#zabbix-30) - + [Zabbix 2.4](#zabbix-24) - + [Zabbix 2.2](#zabbix-22) -- [Installation](#installation) -- [Role Variables](#role-variables) - * [Main variables](#main-variables) - + [Overall Zabbix](#overall-zabbix) - + [Zabbix Server](#zabbix-server) - + [Custom Zabbix Scripts](#custom-zabbix-scripts) - + [TLS Specific configuration](#tls-specific-configuration) - * [Database](#database) -- [Dependencies](#dependencies) -- [Example Playbook](#example-playbook) -- [Molecule](#molecule) -- [Contributors](#contributors) -- [License](#license) -- [Author Information](#author-information) - -# Overview - -Badges: - -[![Build Status](https://travis-ci.org/dj-wasabi/ansible-zabbix-server.svg?branch=master)](https://travis-ci.org/dj-wasabi/ansible-zabbix-server) - -This is a role for installing and maintaining the zabbix-server. - -This is one of the 'dj-wasabi' roles which configures your whole zabbix environment. See below for the complete list: - - * zabbix-web (https://galaxy.ansible.com/dj-wasabi/zabbix-web/) - * zabbix-server (https://galaxy.ansible.com/dj-wasabi/zabbix-server/) - * zabbix-proxy (https://galaxy.ansible.com/dj-wasabi/zabbix-proxy/) - * zabbix-javagateway (https://galaxy.ansible.com/dj-wasabi/zabbix-javagateway/) - * zabbix-agent (https://galaxy.ansible.com/dj-wasabi/zabbix-agent/) - -# Upgrades - -## 1.0.0 - -With this 1.0.0 release, the following is changed: - -* This repository will only contain all the actions that are needed for correctly configuring a Zabbix Server. All tasks regarding the frontend/webui of Zabbix has been transferred to the `dj-wasabi.zabbix-web` role. -* All properties start with `zabbix_` now. Example, property named `server_dbuser` is now `zabbix_server_dbuser`. - -# Requirements - -## Operating systems - -This role will work on the following operating systems: - - * Red Hat - * Debian - * Ubuntu - -So, you'll need one of those operating systems.. :-) -Please send Pull Requests or suggestions when you want to use this role for other Operating systems. - -## Zabbix Versions - -See the following list of supported Operating systems with the Zabbix releases: - -### Zabbix 4.4 - - * CentOS 7.x, 8.x - * Amazon 7.x - * RedHat 7.x, 8.x - * OracleLinux 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 - * RedHat 7.x - * OracleLinux 7.x - * Scientific Linux 7.x - * Ubuntu 14.04, 16.04, 18.04 - * Debian 8, 9 - -### Zabbix 4.0 - - * CentOS 7.x - * Amazon 7.x - * RedHat 7.x - * OracleLinux 7.x - * Scientific Linux 7.x - * Ubuntu 14.04, 16.04, 18.04 - * Debian 8, 9 - -### Zabbix 3.4 - - * CentOS 7.x - * Amazon 7.x - * RedHat 7.x - * OracleLinux 7.x - * Scientific Linux 7.x - * Ubuntu 14.04, 16.04 - * Debian 7, 8, 9 - - -### Zabbix 3.2 - - * CentOS 7.x - * Amazon 7.x - * RedHat 7.x - * OracleLinux 7.x - * Scientific Linux 7.x - * Ubuntu 14.04, 16.04 - * Debian 7, 8 - -### Zabbix 3.0 - - * CentOS 5.x, 6.x, 7.x - * Amazon 5.x, 6.x, 7.x - * RedHat 5.x, 6.x, 7.x - * OracleLinux 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 - * RedHat 6.x, 7.x - * OracleLinux 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 - * RedHat 5.x, 6.x - * OracleLinux 5.x, 6.x - * Scientific Linux 5.x, 6.x - * Ubuntu 12.04 - * Debian 7 - * xenserver 6 - -# Installation - -Installing this role is very simple: `ansible-galaxy install dj-wasabi.zabbix-server` - -Please be aware that this role only installs the Zabbix Server and not the Zabbix Web. If you do want to have a Zabbix Web, please execute the following command: `ansible-galaxy install dj-wasabi.zabbix-web` - -Default username/password for the Zabbix Web interface is the default one installed by Zabbix. - -Username: Admin -Password: zabbix - -# Role Variables - -## Main variables - -The following is an overview of all available configuration default for this role. - -### Overall Zabbix - -* `zabbix_server_version`: This is the version of zabbix. Default: 4.4. Can be overridden to 3.2, 3.0, 2.4, or 2.2. Previously the variable `zabbix_version` was used directly but it could cause [some inconvenience](https://github.com/dj-wasabi/ansible-zabbix-agent/pull/303). That variable is maintained by retrocompativility. -* `zabbix_repo_yum`: A list with Yum repository configuration. -* `zabbix_repo`: Default: _zabbix_ - * _epel_ install agent from EPEL repo - * _zabbix_ (default) install agent from Zabbix repo - * _other_ install agent from pre-existing or other repo -* `zabbix_server_package_state`: Default: _present_. Can be overridden to "latest" to update packages when needed. -* `zabbix_service_state`: Default: `started`. Can be overridden to stopped if needed -* `zabbix_service_enabled`: Default: `True` Can be overridden to `False` if needed -* `zabbix_selinux`: Enables an SELinux policy so that the server will run. Default: False. - -### Zabbix Server - -* `zabbix_server_name`: The name of the Zabbix Server. -* `zabbix_server_database`: The type of database used. Can be: mysql or pgsql -* `zabbix_server_database_long`: The type of database used, but long name. Can be: mysql or postgresql -* `zabbix_server_hostname`: The hostname on which the zabbix-server is running. Default set to: {{ inventory_hostname }} -* `zabbix_server_listenport`: On which port the Zabbix Server is available. Default: 10051 -* `zabbix_server_dbhost`: The hostname on which the database is running. -* `zabbix_server_real_dbhost`: The hostname of the dbhost that is running behind a loadbalancer/VIP (loadbalancers doesn't accept ssh connections) -* `zabbix_server_dbname`: The database name which is used by the Zabbix Server. -* `zabbix_server_dbuser`: The database username which is used by the Zabbix Server. -* `zabbix_server_dbpassword`: The database user password which is used by the Zabbix Server. -* `zabbix_server_dbport`: The database port which is used by the Zabbix Server. -* `zabbix_database_creation`: True / False. When you don't want to create the database including user, you can set it to False. -* `zabbix_server_install_recommends`: True / False. False does not install the recommended packages that come with the zabbix-server install. Default true -* `zabbix_server_install_database_client`: True / False. False does not install database client. Default true -* `zabbix_database_sqlload`:True / False. When you don't want to load the sql files into the database, you can set it to False. -* `zabbix_server_dbencoding`: The encoding for the MySQL database. Default set to `utf8` -* `zabbix_server_dbcollation`: The collation for the MySQL database. Default set to `utf8_bin` -* `zabbix_server_manage_service`: True / False. When you run multiple Zabbix servers in a High Available cluster setup (e.g. pacemaker), you don't want Ansible to manage the zabbix-server service, because Pacemaker is in control of zabbix-server service. - -### Custom Zabbix Scripts - -Define these variables to copy scripts to your respective scripts path. - -* `zabbix_server_alertscripts`: List of alertscripts to be added to `zabbix_server_alertscriptspath` -* `zabbix_server_externalscripts`: List of alertscripts to be added to `zabbix_server_externalscriptspath` - -Example: - -```bash - zabbix_server_alertscripts: - - path: "{{ lookup('first_found', 'zabbix-scripts/somescript.php') }}" - name: "somescript.php" -``` - -### TLS Specific configuration - -These variables are specific for Zabbix 3.0 and higher: - -* `zabbix_server_tlsconnect`: How the agent should connect to server or proxy. Used for active checks. - Possible values: - * unencrypted - * psk - * cert -* `zabbix_server_tlsaccept`: What incoming connections to accept. - Possible values: - * unencrypted - * psk - * cert -* `zabbix_server_tlscafile`: Full pathname of a file containing the top-level CA(s) certificates for peer certificate verification. -* `zabbix_server_tlscrlfile`: Full pathname of a file containing revoked certificates. -* `zabbix_server_tlsservercertissuer`: Allowed server certificate issuer. -* `zabbix_server_tlsservercertsubject`: Allowed server certificate subject. -* `zabbix_server_tlscertfile`: Full pathname of a file containing the agent certificate or certificate chain. -* `zabbix_server_tlskeyfile`: Full pathname of a file containing the agent private key. - -## Database - -There are some zabbix-server specific variables which will be used for the zabbix-server configuration file. These can be found in the defaults/main.yml file. There are 3 which need some explanation: -```bash - #zabbix_server_database: mysql - #zabbix_server_database_long: mysql - zabbix_server_database: pgsql - zabbix_server_database_long: postgresql - [...] - zabbix_server_dbport: 5432 -``` - -There are 2 database_types which will be supported: mysql and postgresql. You'll need to comment or uncomment the database you would like to use and adjust the port number (`server_dbport`) accordingly (`5432` is the default postgresql port). In example from above, the postgresql database is used. If you want to use mysql, uncomment the 2 lines from mysql and comment the 2 lines for postgresql and change the database port to the mysql one (default mysql port is `3306`). - -If you use mysql, then you should define mysql username, password and host to prepare zabbix database, otherwise they will be considered as their default value (and therefore, connecting to database will be considered as connecting to localhost with no password). The keys are below: - -```bash - zabbix_server_mysql_login_host - zabbix_server_mysql_login_user - zabbix_server_mysql_login_password -``` -If you use pgsql, then you should define pgsql username, password and host to prepare zabbix database, otherwise they will be considered as their default value (and therefore, connecting to database will be considered as connecting to localhost with no password). The keys are below: - -```bash - zabbix_server_pgsql_login_host - zabbix_server_pgsql_login_user - zabbix_server_pgsql_login_password -``` - - -# Dependencies - -For the databases you should find a role that suits your needs, as I don't want to force you for using a specific role. Before applying this Zabbix Server role, the database service should already be installed and running, and should be able to handle the modules in Ansible that belong to that database. - -This role will **not** install a MySQL or PostgreSQL service. - -This role will create a Zabbix user and a Zabbix database in the configured database type. - -# Example Playbook - -Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: - - - hosts: zabbix-server - become: yes - roles: - - { role: dj-wasabi.zabbix-server, zabbix_server_database: mysql, zabbix_server_database_long: mysql } - - -# Molecule - -This role is configured to be tested with Molecule. You can find on these pages some more information regarding Molecule: - -* http://werner-dijkerman.nl/2016/07/10/testing-ansible-roles-with-molecule-testinfra-and-docker/ -* http://werner-dijkerman.nl/2016/07/27/extending-ansible-role-testing-with-molecule-by-adding-group_vars-dependencies-and-using-travis-ci/ -* http://werner-dijkerman.nl/2016/07/31/testing-ansible-roles-in-a-cluster-setup-with-docker-and-molecule/ - -# Contributors - -The following have contributed to this Ansible role (List of Fame): - - * drmikecrowe - * srvg - * kostyrevaa - * clopnis - * SAL-e - * lhoss - * mescanef - -# License - -MIT - -# Author Information - -This is my first attempt to create an ansible role, so please send suggestion or pull requests to make this role better. - -Github: https://github.com/dj-wasabi/ansible-zabbix-server - -mail: ikben [ at ] werner-dijkerman . nl diff --git a/roles/zabbix_server/README.md b/roles/zabbix_server/README.md new file mode 120000 index 000000000..643331b63 --- /dev/null +++ b/roles/zabbix_server/README.md @@ -0,0 +1 @@ +../../docs/ZABBIX_SERVER_ROLE.md \ No newline at end of file diff --git a/roles/zabbix_server/inventory b/roles/zabbix_server/inventory deleted file mode 100644 index 285dfd148..000000000 --- a/roles/zabbix_server/inventory +++ /dev/null @@ -1,9 +0,0 @@ -[postgresql] -zabbix-server-pgsql-centos ansible_connection=docker -zabbix-server-pgsql-debian ansible_connection=docker -zabbix-server-pgsql-ubuntu ansible_connection=docker - -[mysql] -zabbix-server-mysql-centos ansible_connection=docker -zabbix-server-mysql-debian ansible_connection=docker -zabbix-server-mysql-ubuntu ansible_connection=docker diff --git a/roles/zabbix_server/setup.cfg b/roles/zabbix_server/setup.cfg deleted file mode 100644 index 1fd489337..000000000 --- a/roles/zabbix_server/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -max-line-length = 160 diff --git a/roles/zabbix_web/CHANGELOG.md b/roles/zabbix_web/CHANGELOG.md deleted file mode 100644 index 3c30bbca9..000000000 --- a/roles/zabbix_web/CHANGELOG.md +++ /dev/null @@ -1,83 +0,0 @@ -# ansible-zabbix-web Release - -Below an overview of all changes in the releases. - -Version (Release date) - -FINAL and LAST release for this role in this repository. This role will be transferred to: https://github.com/ansible-collections/community.zabbix/ - -1.6.0 (2020-05-23) - - * Added installation of selinux package #74 - * 4.4 supports Debian buster #75 (By pull request: lingfish (Thanks!)) - * Avoid conflicts with zabbix_version var #77 (By pull request: santiagomr (Thanks!)) - * adding zabbix_apache_skip_custom_fragment to prevent php_values in conf #79 (By pull request: tobiasehlert (Thanks!)) - * Correcting custom fragment PR 79 #80 (By pull request: tobiasehlert (Thanks!)) - * Adding zabbix_apache_include_custom_fragment to TLS section #81 (By pull request: tobiasehlert (Thanks!)) - * selinux blocking httpd connection to zabbix #82 (By pull request: SimBou (Thanks!)) - * php-fpm, zabbix db schema and apachectl path #85 (By pull request: v (Thanks!)) - -1.5.0 (2019-12-01) - - * Added vhost interface variable #55 (By pull request: okgolove (Thanks!)) - * Minor changes for molecule #56 - * Make Apache optional but keep as default; Closes dj-wasabi/ansible-zabbix-web#58 #59 (By pull request: kr4ut (Thanks!)) - * Refactor PHP pkg install for Debian/Ubuntu; Closes dj-wasabi/ansible-zabbix-web#57 #60 (By pull request: kr4ut (Thanks!)) - * Add update_cache: yes to tasks/RedHat.yml #64 (By pull request: patsevanton (Thanks!)) - * readme update that default is 4.2 #67 (By pull request: fabtho (Thanks!)) - * Update main.yml #68 (By pull request: Vinclame (Thanks!)) - * SELinux boolean added for httpd -> ldap connections #69 (By pull request: Vinclame (Thanks!)) - * Zabbix 44 #71 - * Using travis envs #72 - -1.4.0 (2019-04-14) - - * Fixing the rights for config file #39 - * Fixing the require line #40 - * Removed the _type string in various places #42 - * adds support for elasticsearch history storage #43 (By pull request: MartinHell (Thanks!)) - * Always include OS variables #44 (By pull request: jrgoldfinemiddleton (Thanks!)) - * skip repo file when zabbix_repo="other" #45 (By pull request: wschaft (Thanks!)) - * Removal of links to files provided by Zabbix #47 - * Fix apt module deprecation notice #49 (By pull request: logan2211 (Thanks!)) - * fix apache servername regex to support hyphen character #51 (By pull request: wschaft (Thanks!)) - * get the apache version also in check mode #52 (By pull request: wschaft (Thanks!)) - * Updating to Zabbix 4.2 #53 - -1.3.0 (2018-10-20) - - * Add zabbix 40 #33 - * Modify use of zabbix server packages #35 (By pull request: average-joe (Thanks!)) - * Fix for: update readme to include correct examples #32 - -1.2.0 (2018-09-11) - - * Updated supported versions #27 - * Readme lang typos grammar #28 (By pull request: dnmvisser (Thanks!)) - * Reflect license change to MIT in README #29 (By pull request: stephankn (Thanks!)) - * Fix for #24 #30 - * Fix for: SSLPassPhraseDialog setting problems - /usr/libexec/httpd-ss… #31 - -1.1.0 (2018-06-23) - - * added support for HTTPS #25 (By pull request: q1x (Thanks!)) - * Make debian 9 work #22 - * Updated minimal Ansible version to 2.4 #21 - * Changed version_compare operator to avoid deprecation warnings #19 (By pull request: nidr0x (Thanks!)) - * Most of the time php behaves better with leading semicolon. #17 (By pull request: toke (Thanks!)) - * add php7.0-gd #16 (By pull request: scil (Thanks!)) - * Fixed missing attribute iteritems #15 (By pull request: toke (Thanks!)) - * Allow usage of php environment variables #13 (By pull request: toke (Thanks!)) - * Make use of Molecule V2 - * Add support for debian stretch #7 (By pull request: dulin (Thanks!)) - * Fix Zabbix graph legend bug for Debian packages (see ZBX-10467) #6 (By pull request: mgornikov (Thanks!)) - * Split zabbix_url and Apache vhost ServerName #5 (By pull request: eshikhov (Thanks!)) - -1.0.0 (2017-08-30) - - * Removed tags 'always' on few tasks. - * Fix for: Installing Zabbix-Web-MySQL Failed #1 - -0.1.0 (2017-06-16) - - * Initial working version. diff --git a/roles/zabbix_web/CODE_OF_CONDUCT.md b/roles/zabbix_web/CODE_OF_CONDUCT.md deleted file mode 100644 index e28ac17f7..000000000 --- a/roles/zabbix_web/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,3 +0,0 @@ -# Code of Conduct - -The Code of Conduct from Ansible found [here](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html) applies to this Ansible role as well. diff --git a/roles/zabbix_web/CONTRIBUTING.md b/roles/zabbix_web/CONTRIBUTING.md deleted file mode 100644 index 4b8af3768..000000000 --- a/roles/zabbix_web/CONTRIBUTING.md +++ /dev/null @@ -1,88 +0,0 @@ -# Contributing to this role - -**Table of content** - -- [Contributing to this role](#contributing-to-this-role) - * [Contributing](#contributing) - * [(local) Development](#-local--development) - + [Requirements](#requirements) - + [Execution](#execution) -- [Other](#other) - * [Virtualenv](#virtualenv) - * [Links](#links) - -Thank you very much for making time to improve this Ansible role. - -## Contributing - -Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. [Contributor Code of Conduct](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html). - -1. Fork the repo - -2. Create a branch and apply your changes to this branch. - - a. Make sure you have updated the documentation when adding new variables; - - b. Don't forget to add/update tests so we can test the functionality during each Pull Request; - - c. Make sure the tests will succeed. - -3. Push the branch to your fork and submit a pull request. - -**Note** - -Pull Requests that fails during the tests will not be merged. - -## Coding Guidelines - -Style guides are important because they ensure consistency in the content, look, and feel of a book or a website. - -* [Ansible Style Guide](http://docs.ansible.com/ansible/latest/dev_guide/style_guide/) -* It's "Ansible" when referring to the product and ``ansible`` when referring to the command line tool, package, etc -* Playbooks should be written in multi-line YAML with ``key: value``. The form ``key=value`` is only for ``ansible`` ad-hoc, not for ``ansible-playbook``. -* Tasks should always have a ``name:`` - -## (local) Development - -This role make use of Molecule to test the execution of the role and verificate it. In the root of the repository, a file named `requirements.txt` exists and contains the versions used by the tests. - -### Requirements - -You can install them with the following command: - -``` -pip install -r requirements.txt -``` - -Once the dependencies are installed, please install Docker as Molecule is configured in this repository to create Docker containers. See [this](https://docs.docker.com/install/) link to install Docker on your system. - -### Execution - -Once everything is installed, you can validate your changes by executing: -``` -molecule test -``` - -It should run without any issues. - -# Other - -## Virtualenv - -Suggestion is to create a virtualenv so you won't have issues with other projects. - -Some web pages describing for virtual env: - -* http://thepythonguru.com/python-virtualenv-guide/ -* https://realpython.com/python-virtual-environments-a-primer/ -* https://www.dabapps.com/blog/introduction-to-pip-and-virtualenv-python/ - -## Links - -[Molecule](https://molecule.readthedocs.io/) - -[Ansible](https://www.ansible.com/) - -[Molecule V2 with your own role](https://werner-dijkerman.nl/2017/09/05/using-molecule-v2-to-test-ansible-roles/) - -**End note**: Have fun making changes. If a feature helps you, then others find it helpful too and I will happily have it merged. diff --git a/roles/zabbix_web/LICENSE b/roles/zabbix_web/LICENSE deleted file mode 100644 index 6922fb326..000000000 --- a/roles/zabbix_web/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Werner Dijkerman - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/roles/zabbix_web/PULL_REQUEST_TEMPLATE.md b/roles/zabbix_web/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 70c5edefc..000000000 --- a/roles/zabbix_web/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,12 +0,0 @@ -**Description of PR** - - -**Type of change** - - -Feature Pull Request -Bugfix Pull Request -Docs Pull Request - -**Fixes an issue** - diff --git a/roles/zabbix_web/README.md b/roles/zabbix_web/README.md deleted file mode 100644 index 164aafa61..000000000 --- a/roles/zabbix_web/README.md +++ /dev/null @@ -1,326 +0,0 @@ -Table of Contents - -- [Overview](#overview) -- [Requirements](#requirements) - * [Operating Systems](#operating-systems) - * [Zabbix Versions](#zabbix-versions) - + [Zabbix 4.4](#zabbix-44) - + [Zabbix 4.2](#zabbix-42) - + [Zabbix 4.0](#zabbix-40) - + [Zabbix 3.4](#zabbix-34) - + [Zabbix 3.2](#zabbix-32) - + [Zabbix 3.0](#zabbix-30) - + [Zabbix 2.4](#zabbix-24) - + [Zabbix 2.2](#zabbix-22) -- [Installation](#installation) -- [Role Variables](#role-variables) - * [Main variables](#main-variables) - + [Overall Zabbix](#overall-zabbix) - + [Zabbix Web specific](#zabbix-web-specific) - + [Zabbix Server](#zabbix-server) - * [Examples of configuration](#examples-of-configuration) - + [zabbix_repo_yum](#zabbix-repo-yum) -- [Dependencies](#dependencies) -- [Example Playbook](#example-playbook) - * [Single instance](#single-instance) - * [Multi host setup](#multi-host-setup) - * [Adding Environment Variables for zabbix_web](#adding-environment-variables-for-zabbix-web) -- [Molecule](#molecule) -- [License](#license) -- [Author Information](#author-information) - -# Overview - -This role is migrated to: https://github.com/ansible-collections/community.zabbix/ -In this repository, a read only version is/will be available for those who can not make use of collections (yet). Changes/updates will only be applied to the collection and not in this repository. - -# Requirements -## Operating Systems - -This role will work on the following operating systems: - - * RedHat - * Debian - * Ubuntu - -So, you'll need one of those operating systems.. :-) -Please sent Pull Requests or suggestions when you want to use this role for other Operating Systems. - -## Zabbix Versions - -See the following list of supported Operating Systems with the Zabbix releases. - -### Zabbix 4.4 - * CentOS 7.x, 8.x - * Amazon 7.x - * RedHat 7.x, 8.x - * OracleLinux 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 - * RedHat 7.x - * OracleLinux 7.x - * Scientific Linux 7.x - * Ubuntu 14.04, 16.04, 18.04 - * Debian 8, 9 - -### Zabbix 4.0 - - * CentOS 7.x - * Amazon 7.x - * RedHat 7.x - * OracleLinux 7.x - * Scientific Linux 7.x - * Ubuntu 14.04, 16.04, 18.04 - * Debian 8, 9 - -### Zabbix 3.4 - - * CentOS 7.x - * Amazon 7.x - * RedHat 7.x - * OracleLinux 7.x - * Scientific Linux 7.x - * Ubuntu 14.04, 16.04 - * Debian 7, 8, 9 - -### Zabbix 3.2 - - * CentOS 7.x - * Amazon 7.x - * RedHat 7.x - * OracleLinux 7.x - * Scientific Linux 7.x - * Ubuntu 14.04, 16.04 - * Debian 7, 8 - -### Zabbix 3.0 - - * CentOS 5.x, 6.x, 7.x - * Amazon 5.x, 6.x, 7.x - * RedHat 5.x, 6.x, 7.x - * OracleLinux 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 - * RedHat 6.x, 7.x - * OracleLinux 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 - * RedHat 5.x, 6.x - * OracleLinux 5.x, 6.x - * Scientific Linux 5.x, 6.x - * Ubuntu 12.04 - * Debian 7 - * xenserver 6 - -# Installation - -Installing this role is very simple: `ansible-galaxy install dj-wasabi.zabbix-web` - -When the Zabbix Web needs to be running on the same host as the Zabbix Server, please also install the Zabbix Server by executing the following command: `ansible-galaxy install dj-wasabi.zabbix-server` - - Default username/password for the Zabbix Web interface is the default. - - Username: Admin - Password: zabbix - -# Role Variables - -## Main variables - -The following is an overview of all available configuration defaults for this role. - -### Overall Zabbix - -* `zabbix_web_version`: This is the version of zabbix. Default: 4.4, Can be overridden to 4.0, 3.4, 3.2, 3.0, 2.4, or 2.2. Previously the variable `zabbix_version` was used directly but it could cause [some inconvenience](https://github.com/dj-wasabi/ansible-zabbix-agent/pull/303). That variable is maintained by retrocompativility. -* `zabbix_repo_yum`: A list with Yum repository configuration. -* `zabbix_web_package_state`: Default: _present_. Can be overridden to "latest" to update packages when needed. - -### Zabbix Web specific - -* `zabbix_url`: This is the url on which the zabbix web interface is available. Default is zabbix.example.com, you should override it. For example, see "Example Playbook" -* `zabbix_url_aliases`: A list with Aliases for the Apache Virtual Host configuration. -* `zabbix_timezone`: This is the timezone. The Apache Virtual Host needs this parameter. Default: Europe/Amsterdam -* `zabbix_vhost`: True / False. When you don't want to create an Apache Virtual Host configuration, you can set it to False. -* `zabbix_apache_vhost_port`: The port on which Zabbix HTTP vhost is running. -* `zabbix_apache_vhost_tls_port`: The port on which Zabbix HTTPS vhost is running. -* `zabbix_apache_vhost_port`: On which port the Apache Virtual Host is available. -* `zabbix_apache_vhost_listen_ip`: On which interface the Apache Virtual Host is available. -* `zabbix_apache_can_connect_ldap`: True / False. Set SELinux boolean to allow httpd to connect to LDAP. Default is False. -* `zabbix_php_install`: True / False. Switch for extra install of packages for PHP, currently on for Debian/Ubuntu. Default is true. -* `zabbix_web_max_execution_time`: -* `zabbix_web_memory_limit`: -* `zabbix_web_post_max_size`: -* `zabbix_web_upload_max_filesize`: -* `zabbix_web_max_input_time`: -* `zabbix_apache_include_custom_fragment`: True / False. Includes php_value vars max_execution_time, memory_limit, post_max_size, upload_max_filesize, max_input_time and date.timezone in vhost file.. place those in php-fpm configuration. Default is true. -* `zabbix_web_env`: (Optional) A Dictionary of PHP Environments - -The following properties are related when TLS/SSL is configured: - -* `zabbix_apache_tls`: If the Apache vhost should be configured with TLS encryption or not. -* `zabbix_apache_redirect`: If a redirect should take place from HTTP to HTTPS -* `zabbix_apache_tls_crt`: The path to the TLS certificate file. -* `zabbix_apache_tls_key`: The path to the TLS key file. -* `zabbix_apache_tls_chain`: The path to the TLS certificate chain file. -* `zabbix_apache_SSLPassPhraseDialog`: Type of pass phrase dialog for encrypted private keys. -* `zabbix_apache_SSLSessionCache`: Type of the global/inter-process SSL Session Cache -* `zabbix_apache_SSLSessionCacheTimeout`: Number of seconds before an SSL session expires in the Session Cache -* `zabbix_apache_SSLCryptoDevice`: Enable use of a cryptographic hardware accelerator - -When `zabbix_apache_tls_crt`, `zabbix_apache_tls_key` and/or `zabbix_apache_tls_chain` are used, make sure that these files exists before executing this role. The Zabbix-Web role will not install the mentioned files. - -See https://httpd.apache.org/docs/current/mod/mod_ssl.html for SSL* configuration options for Apache HTTPD. - -### Zabbix Server - -* `zabbix_server_name`: The name of the Zabbix Server. -* `zabbix_server_database`: The type of database used. Can be: mysql or pgsql -* `zabbix_server_database_long`: The type of database used, but long name. Can be: mysql or postgresql -* `zabbix_server_hostname`: The hostname on which the zabbix-server is running. Default set to: {{ inventory_hostname }} -* `zabbix_server_listenport`: On which port the Zabbix Server is available. Default: 10051 -* `zabbix_server_dbhost`: The hostname on which the database is running. -* `zabbix_server_dbname`: The database name which is used by the Zabbix Server. -* `zabbix_server_dbuser`: The database username which is used by the Zabbix Server. -* `zabbix_server_dbpassword`: The database user password which is used by the Zabbix Server. -* `zabbix_server_dbport`: The database port which is used by the Zabbix Server. - -The following properties are related when using Elasticsearch for history storage: - -* `zabbix_server_history_url`: String with url to the Elasticsearch server or a list if the types are stored on different Elasticsearch URLs. -* `zabbix_server_history_types`: List of history types to store in Elasticsearch. - -See the following links for more information regarding Zabbix and Elasticsearch -https://www.zabbix.com/documentation/3.4/manual/appendix/install/elastic_search_setup -https://www.zabbix.com/documentation/4.0/manual/appendix/install/elastic_search_setup - -## Examples of configuration - -### zabbix_repo_yum - -Current default configuration and example for specifying a yum repository: - -```` -zabbix_repo_yum: - - name: zabbix - description: Zabbix Official Repository - $basearch - baseurl: http://repo.zabbix.com/zabbix/{{ zabbix_version }}/rhel/{{ ansible_distribution_major_version }}/$basearch/ - gpgcheck: 0 - gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX - state: present - - name: zabbix - description: Zabbix Official Repository non-supported - $basearch - baseurl: http://repo.zabbix.com/non-supported/rhel/{{ ansible_distribution_major_version }}/$basearch/ - gpgcheck: 0 - gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX - state: present -```` - -# Dependencies - -This role has one dependency for Apache usage: geerlingguy.apache. Via the variable zabbix_websrv != 'apache' this can be skipped. - -As it is also possible to run the zabbix-web on a different host than the zabbix-server, the zabbix-server is not configured to be an dependency. - -# Example Playbook - -There are two ways of using the zabbix-web: - -* Single instance -* Multi host setup - -## Single instance - -When there is one host running both Zabbix Server and the Zabbix Web (Running MySQL as database): - -``` -- hosts: zabbix-server - become: yes - roles: - - { role: geerlingguy.apache } - - { role: dj-wasabi.zabbix-server, zabbix_server_database: mysql, zabbix_server_database_long: mysql, zabbix_server_dbport: 3306 } - - { role: dj-wasabi.zabbix-web, zabbix_url: zabbix.dj-wasabi.nl, zabbix_server_database: mysql, zabbix_server_database_long: mysql, zabbix_server_dbport: 3306} -``` - -## Multi host setup - -This is a two host setup. On one host (Named: "zabbix-server") the Zabbix Server is running, and the other host (Named: zabbix-web) runs Zabbix Web (with MySQL as database): - -``` -- hosts: zabbix-server - become: yes - roles: - - { role: dj-wasabi.zabbix-server, zabbix_server_database: mysql, zabbix_server_database_long: mysql, zabbix_server_dbport: 3306 } - -- hosts: zabbix-web - become: yes - roles: - - { role: geerlingguy.apache } - - { role: dj-wasabi.zabbix-web, zabbix_server_hostname: zabbix-server, zabbix_url: zabbix.dj-wasabi.nl, zabbix_server_database: mysql, zabbix_server_database_long: mysql, zabbix_server_dbport: 3306 } -``` - -## Adding Environment Variables for zabbix_web - -Sometimes you need to add environment variables to your -zabbix.conf.php, for example to add LDAP CA certificates. To do this add a `zabbix_web_env` dictionary: - -``` -- { role: dj-wasabi.zabbix-web, zabbix_url: zabbix.dj-wasabi.nl, zabbix_server_database: mysql, zabbix_server_database_long: mysql, zabbix_server_dbport: 3306, zabbix_web_env: {LDAPTLS_CACERT: /etc/ssl/certs/ourcert.pem} -``` - -## Using Elasticsearch for history storage - -To use Elasticsearch for history storage you need to configure the `zabbix_server_history_url` and `zabbix_server_history_types`. You will also need to configure Elasticsearch -in the zabbix-server (https://galaxy.ansible.com/dj-wasabi/zabbix-server/) role. - -Zabbix can store the following history types -in Elasticsearch: -* Numeric (unsigned) - `uint` -* Numeric (float) - `dbl` -* Character - `str` -* Log - `log` -* Text - `text` - -To store all history types in the same history URL the following variables should be set (make sure history url points to your Elasticsearch cluster): - -``` -zabbix_server_history_url: "http://localhost:9200" -zabbix_server_history_types: - - 'str' - - 'text' - - 'log' - - 'uint' - - 'dbl' -``` - -# Molecule - -This role is configured to be tested with Molecule. Molecule will boot at least 3 different kinds of containers, one for each supported Operating System (Debian, Ubuntu and RedHat). -Pull Requests are only merged when the tests are successful. - -For more information, please check the following page: https://www.werner-dijkerman.nl/2016/07/10/testing-ansible-roles-with-molecule-testinfra-and-docker - -# License - -MIT - -# Author Information - -Github: https://github.com/dj-wasabi/ansible-zabbix-web - -mail: ikben [ at ] werner-dijkerman . nl diff --git a/roles/zabbix_web/README.md b/roles/zabbix_web/README.md new file mode 120000 index 000000000..a682bdb7e --- /dev/null +++ b/roles/zabbix_web/README.md @@ -0,0 +1 @@ +../../docs/ZABBIX_WEB_ROLE.md \ No newline at end of file diff --git a/roles/zabbix_web/ansible.cfg b/roles/zabbix_web/ansible.cfg deleted file mode 100644 index 4ee279bd3..000000000 --- a/roles/zabbix_web/ansible.cfg +++ /dev/null @@ -1,3 +0,0 @@ -[defaults] -roles_path = ../:../../ -hostfile = inventory diff --git a/roles/zabbix_web/inventory b/roles/zabbix_web/inventory deleted file mode 100644 index c187db55a..000000000 --- a/roles/zabbix_web/inventory +++ /dev/null @@ -1,9 +0,0 @@ -[postgresql] -zabbix-web-pgsql-centos ansible_connection=docker -zabbix-web-pgsql-debian ansible_connection=docker -zabbix-web-pgsql-ubuntu ansible_connection=docker - -[mysql] -zabbix-web-mysql-centos ansible_connection=docker -zabbix-web-mysql-debian ansible_connection=docker -zabbix-web-mysql-ubuntu ansible_connection=docker diff --git a/roles/zabbix_web/setup.cfg b/roles/zabbix_web/setup.cfg deleted file mode 100644 index 1fd489337..000000000 --- a/roles/zabbix_web/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -max-line-length = 160