An open API service indexing awesome lists of open source software.

https://github.com/ansibleguy/sw_zabbix_server

Ansible Role to provision dockerized Zabbix-Server
https://github.com/ansibleguy/sw_zabbix_server

ansible ansible-role automation dockerized iac infrastructure-as-code monitoring zabbix zabbix-server

Last synced: 3 months ago
JSON representation

Ansible Role to provision dockerized Zabbix-Server

Awesome Lists containing this project

README

        


Zabbix Logo

# Ansible Role - Zabbix Server Dockerized

Role to deploy dockerized Zabbix Server on a Linux Server.

[![Lint](https://github.com/ansibleguy/sw_zabbix_server/actions/workflows/lint.yml/badge.svg)](https://github.com/ansibleguy/sw_zabbix_server/actions/workflows/lint.yml)
[![Ansible Galaxy](https://badges.ansibleguy.net/galaxy.badge.svg)](https://galaxy.ansible.com/ui/standalone/roles/ansibleguy/sw_zabbix_server)

**Molecule Integration-Tests**:

* Status: [![Molecule Test Status](https://badges.ansibleguy.net/sw_zabbix_server.molecule.svg)](https://github.com/ansibleguy/_meta_cicd/blob/latest/templates/usr/local/bin/cicd/molecule.sh.j2) |
[![Functional-Tests](https://github.com/ansibleguy/sw_zabbix_server/actions/workflows/integration_test_result.yml/badge.svg)](https://github.com/ansibleguy/sw_zabbix_server/actions/workflows/integration_test_result.yml)
* Logs: [API](https://ci.ansibleguy.net/api/job/ansible-test-molecule-sw_zabbix_server/logs?token=2b7bba30-9a37-4b57-be8a-99e23016ce70&lines=1000) | [Short](https://badges.ansibleguy.net/log/molecule_sw_zabbix_server_test_short.log) | [Full](https://badges.ansibleguy.net/log/molecule_sw_zabbix_server_test.log)

Internal CI: [Tester Role](https://github.com/ansibleguy/_meta_cicd) | [Jobs API](https://github.com/O-X-L/github-self-hosted-jobs-systemd)

**Tested:**
* Debian 12

----

## Install

```bash
# latest
ansible-galaxy role install git+https://github.com/ansibleguy/sw_zabbix_server

# from galaxy
ansible-galaxy install ansibleguy.sw_zabbix_server

# or to custom role-path
ansible-galaxy install ansibleguy.sw_zabbix_server --roles-path ./roles

# install dependencies
ansible-galaxy install -r requirements.yml
```

----

## Advertisement

* Need **professional support** using Ansible or Zabbix? Contact us:

E-Mail: [[email protected]](mailto:[email protected])

Tel: [+43 3115 40 900 0](tel:+433115409000)

Web: [EN](https://www.o-x-l.com) | [DE](https://www.oxl.at)

Language: German or English

* You want a simple **Ansible GUI**?

Check-out this [Ansible WebUI](https://github.com/ansibleguy/webui)

----

## Usage

### Config

Minimal example:

```yaml
zabbix_server:
domain: 'mon.template.ansibleguy.net'

db:
root_pwd: !vault |
...
app_pwd: !vault |
...
```

Define the config as needed:

```yaml
zabbix_server:
version: '7.0' # see docker image tags

domain: 'mon.template.ansibleguy.net'
aliases:
- 'monitoring.template.ansibleguy.net'

# provide settings as environmental variables
settings:
# see: https://hub.docker.com/r/zabbix/zabbix-web-nginx-mysql
frontend:
ZBX_SERVER_NAME: 'AnsibleGuy Monitoring'
ZBX_SERVER_PORT: 10151

# see: https://hub.docker.com/r/zabbix/zabbix-server-mysql
backend:
ZBX_LISTENPORT: 10151

db:
root_pwd: !vault |
...
app_pwd: !vault |
...
```

You might want to use 'ansible-vault' to encrypt your passwords:
```bash
ansible-vault encrypt_string
```

### Execution

Run the playbook:
```bash
ansible-playbook -K -D -i inventory/hosts.yml playbook.yml
```

There are also some useful **tags** available:
* docker
* config
* backup
* update

To debug errors - you can set the 'debug' variable at runtime:
```bash
ansible-playbook -K -D -i inventory/hosts.yml playbook.yml -e debug=yes
```

----

## Functionality

* **Package installation**
* Ansible dependencies (_minimal_)
* Docker server + client
* Nginx Webserver
* MariaDB client

* **Configuration**
* MariaDB database container
* **Default opt-ins**:
* Auto-Update
* Installing and Configuring Nginx Webserver

----

## Info

* **Note:** this role currently only supports debian-based systems

* **Note:** Most of the role's functionality can be opted in or out.

For all available options - see the default-config located in [the main defaults-file](https://github.com/ansibleguy/sw_zabbix_server/blob/latest/defaults/main/1_main.yml)!

* **Warning:** Not every setting/variable you provide will be checked for validity. Bad config might break the role!

* **Info:** The default Zabbix Server Login is:

User: **Admin**
Password: **zabbix**