45 lines
997 B
YAML
45 lines
997 B
YAML
---
|
||
- name: Install Icinga Web 2 and dependencies
|
||
apt:
|
||
name:
|
||
- icingaweb2
|
||
- icingacli
|
||
- monitoring-plugins-contrib
|
||
- icinga-x509
|
||
- apache2
|
||
- php
|
||
- php-mysql
|
||
- php-xml
|
||
- php-intl
|
||
- php-cli
|
||
- php-gd
|
||
- php-curl
|
||
state: present
|
||
update_cache: yes
|
||
|
||
- name: Create Icinga Web 2 DB
|
||
community.mysql.mysql_db:
|
||
name: "{{ icingaweb2_db_name }}"
|
||
state: present
|
||
login_user: root
|
||
login_password: "{{ mariadb_root_password }}"
|
||
|
||
- name: Create Icinga Web 2 DB user
|
||
community.mysql.mysql_user:
|
||
name: "{{ icingaweb2_db_user }}"
|
||
password: "{{ icingaweb2_db_password }}"
|
||
priv: "{{ icingaweb2_db_name }}.*:ALL"
|
||
host: localhost
|
||
state: present
|
||
login_user: root
|
||
login_password: "{{ mariadb_root_password }}"
|
||
|
||
# Optional: Setup from CLI (optional – often done in web UI)
|
||
# icingacli setup config directory etc.
|
||
|
||
- name: Restart apache2
|
||
service:
|
||
name: apache2
|
||
state: restarted
|
||
|