Automated deployment and configuration of a complete Icinga2 monitoring infrastructure using Ansible.
- Jinja 96%
- Python 3.1%
- Makefile 0.9%
| .ansible | ||
| .helper | ||
| group_vars | ||
| host_vars/icinga | ||
| inventories | ||
| tasks | ||
| templates | ||
| .gitignore | ||
| ansible.cfg | ||
| makefile | ||
| pb-ping.yml | ||
| pb-snclient.yml | ||
| pb.yml | ||
| README.md | ||
| requirements.yml | ||
Icinga2 Ansible Deployment
Automated deployment and configuration of a complete Icinga2 monitoring infrastructure using Ansible.
Overview
This playbook installs and configures the following components:
- Icinga2: Open-source monitoring and alerting system
- Icinga Web 2: Web user interface for Icinga2
- Icinga DB: Document store for Icinga2 data
- Redis: In-memory data store for caching and queues
- Postfix: Mail server for notifications
- Icinga Notifications: Notification system
- Linuxfabrik Library: Plugin collection for Linux monitoring
- PerfDataGraphs: Graphical visualization of performance data
Requirements
- GNU Make
- Ansible 2.9 or higher
- Target host with supported Linux operating system (e.g., Rocky Linux, AlmaLinux, Debian, Ubuntu)
- Root or sudo access on target hosts
- Internet connection for package installation
- Minimum 2 CPU cores and 4 GB RAM recommended
Installation
1. Configure inventory
[icinga]
monitoring-server.example.com ansible_host=192.168.1.10
See inventories/hosts for details.
2. Install dependencies
make install
This installs all required Ansible Galaxy roles from requirements.yml.
3. Execute playbook
# Full installation
make run-icinga
# Fast installation only (skips heavy tasks)
make run-icinga-fast
# Validate configuration (check mode)
make check-icinga
# Syntax check
make validate-icinga
Make Targets
Playbook Execution
| Target | Description |
|---|---|
make run-icinga |
Installs and configures Icinga2 completely |
make run-icinga-fast |
Installs only essential components (skips heavy tasks) |
make check-icinga |
Performs dry-run (check mode with diff) |
make check-icinga-fast |
Dry-run for essential components only |
make validate-icinga |
Checks playbook syntax |
General Commands
| Target | Description |
|---|---|
make help |
Shows all available commands |
make version |
Shows Ansible and ansible-lint versions |
make install |
Installs Galaxy dependencies |
Tags
The playbook supports the following tags for targeted deployment:
| Tag | Function |
|---|---|
fast |
Skipped when using run-icinga-fast |
Common Tasks
Simulate installation (without making changes)
make check-icinga
Shows all planned changes without executing them.
Fast installation only
make run-icinga-fast
Skips slow tasks like package installation.
Validate syntax before execution
make validate-icinga
Display setup token
ssh user@monitoring-server.example.com
icingacli setup token show
Validate Icinga2 configuration
icinga2 daemon -C