mkayontour.icingaweb2
ansible-icingaweb2
This is an Ansible role to install and fully configure Icinga Web 2. It handles the installation of the necessary packages, configures all required files, and sets up the monitoring module.
Additionally, it makes it easy to install and enable Icinga Web 2 modules. However, you'll need to manually configure those modules or use a separate role for that.
Installation
To install this role, run:
ansible-galaxy install mkayontour.icingaweb2
Requirements
This role does not have specific requirements, but keep these in mind:
- Choose and install your web server before setting up Icinga Web 2.
- You will need a role that sets up a running database. Make sure to import the database schema first if you want to use authentication. If you plan to use LDAP or external authentication, the database setup is not necessary.
Here's how to import the Icinga Web 2 database schema:
- name: Import Icinga Web 2 database schema.
mysql_db:
name: icingaweb
state: import
target: /usr/share/icingaweb2/etc/schema/mysql.schema.sql
login_user: icingaweb
login_password: icingaweb
login_host: localhost
Role Variables
Installation
The following variables control what is managed:
icingaweb2_manage_package: yes
icingaweb2_manage_centos_scl: yes
icingaweb2_manage_repository: yes
If you want the Director (a management tool) to be included, set this variable:
icingaweb2_manage_director: yes
Icinga Web 2 Configuration
resources.ini
Resources for Icinga Web 2 are defined in the icingaweb2_resources
dictionary. Each resource has a name and the necessary options.
icingaweb2_resources:
icinga_ido:
type: db
db: mysql
host: localhost
dbname: icinga
username: icinga
password: icinga
use_ssl: 0
charset: utf8
icingaweb_db:
type: db
db: mysql
host: localhost
dbname: icingaweb
username: icingaweb
password: icingaweb
use_ssl: 0
Each configuration file for Icinga Web 2 has its own dictionary.
groups.ini
icingaweb2_groups:
icingaweb2:
backend: db
resource: icingaweb_db
authentication.ini
icingaweb2_authentication:
icingaweb2:
backend: db
resource: icingaweb_db
config.ini
icingaweb2_config:
global:
show_stacktraces: 1
show_application_state_messages: 1
config_backend: ini
module_path: /usr/share/icingaweb2/modules
logging:
log: syslog
level: ERROR
application: icingaweb2
facility: user
themes:
default: Icinga
To automatically configure roles, use the icingaweb2_roles
dictionary. If this variable isn’t defined, the task will be skipped.
icingaweb2_roles:
administrators:
users: icinga
permissions: "*"
groups: Administrators
Monitoring Module
The monitoring module is installed by default. To configure it, use the following dictionaries.
icingaweb2_monitoring_config:
security:
protected_customvars: "*pw*,*pass*,community"
icingaweb2_monitoring_backends:
icinga:
type: ido
resource: icinga_ido
icingaweb2_monitoring_commandtransports:
icinga2:
transport: api
host: localhost
port: 5665
username: root
password: root
Adding Icinga Web 2 Modules
You can add specific modules to Icinga Web 2 with the following list. Make sure to include the monitoring module.
icingaweb2_modules:
- name: monitoring
# - name: director
# git_url: https://github.com/Icinga/icingaweb2-module-director.git
# version: v1.7.2
# - name: ipl
# git_url: https://github.com/Icinga/icingaweb2-module-ipl.git
# version: v0.5.0
Director
Ensure that the git repository for the Director is installed or use the feature to add Icinga Web 2 modules.
To manage the Director, enable it using the variable icingaweb2_manage_director
. To enable the systemd service for the Director, use icingaweb2_manage_director_service
.
You will also need to configure the following for config.ini and kickstart.ini:
config.ini
icingaweb2_director_resource
: Name of the Director resource.
kickstart.ini
These variables configure the kickstart process:
icingaweb2_director_kickstart_endpoint:
The endpoint name for the kickstart script.icingaweb2_director_kickstart_host:
The hostname or IP address (default: "localhost").icingaweb2_director_kickstart_port:
The default port (5665).icingaweb2_director_kickstart_username:
The Director API username (default: "root").icingaweb2_director_kickstart_password:
The Director API password (default: "root").
Dependencies
There are no dependencies for this module.
Example Playbook
Here is an example of how to use this role in a playbook:
- hosts: icingaweb2
roles:
- { role: mkayontour.icingaweb2 }
License
Apache-2.0
Author Information
Follow on Twitter: @mkayontour
Installs and configures Icinga Web 2 on Rhel, Debian and Ubuntu
ansible-galaxy install mkayontour.icingaweb2