-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adds local/vagrant/vbox test scenario * adds role icingaweb2 * Adds IcingaDB-Web support (#159) * provides generic module configuration * adds docu and remove examples * removes python2 unittests * adds documentation for modules --------- Co-authored-by: Daniel Bodky <dbodky@gmail.com>
- Loading branch information
1 parent
51024ab
commit 4077df4
Showing
34 changed files
with
939 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
## Module Director | ||
|
||
The module Icinga Director provides a management GUI for Icinga 2 DSL. | ||
|
||
## Configuration | ||
|
||
The general module parameter like `enabled` and `source` can be applied here. | ||
|
||
For every config file, create a dictionary with sections as keys and the parameters as values. For all parameters please check the [module documentation](https://icinga.com/docs/icinga-director/latest/doc/03-Automation/) | ||
|
||
The database resource won't be created | ||
as Icinga Web 2 resource, please use the `icingaweb2_resources` variable to define | ||
the resource. | ||
|
||
`import_schema`: Checks for pending migrations on the database and applies them if needed. | ||
|
||
`run_kickstart`: Runs kickstart when needed, please make sure the api user is available before. | ||
|
||
|
||
|
||
``` | ||
icingaweb2_modules: | ||
director: | ||
enabled: true | ||
source: package | ||
import_schema: true | ||
run_kickstart: true | ||
kickstart: | ||
config: | ||
endpoint: "{{ ansible_fqdn }}" | ||
host: 127.0.0.1 | ||
username: root | ||
password: root | ||
config: | ||
db: | ||
resource: director_db | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
## Module IcingaDB | ||
|
||
This module IcingaDB is the replacement for the monitoring module with IcingaDB as database backend. | ||
|
||
## Configuration | ||
|
||
The general module parameter like `enabled` and `source` can be applied here. | ||
|
||
For every config file, create a dictionary with sections as keys and the parameters as values. For all parameters please check the [module documentation](https://icinga.com/docs/icinga-db-web/latest/doc/01-About/) | ||
|
||
``` | ||
icingaweb2_modules: | ||
icingadb: | ||
enabled: true | ||
source: package | ||
commandtransports: | ||
instance01: | ||
transport: api | ||
host: 127.0.0.1 | ||
username: root | ||
password: root | ||
config: | ||
icingadb: | ||
resource: icingadb | ||
redis: | ||
tls: '0' | ||
redis: | ||
redis1: | ||
host: "192.168.56.200" | ||
redis2: | ||
host: "192.168.56.201" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
## Module Monitoring | ||
|
||
The module Monitoring is the main module for the deprecated IDO backend. | ||
|
||
## Configuration | ||
|
||
The general module parameter `enabled` be applied here. | ||
|
||
For every config file, create a dictionary with sections as keys and the parameters as values. For all parameters please check the [module documentation](https://icinga.com/docs/icinga-web/latest/doc/03-Configuration/#configuration) | ||
|
||
``` | ||
icingaweb2_modules: | ||
monitoring: | ||
enabled: true | ||
commandtransports: | ||
icinga2_api: | ||
transport: api | ||
host: localhost | ||
username: root | ||
password: changeme | ||
backends: | ||
icinga2_ido_mysql: | ||
type: ido | ||
resource: icinga_ido | ||
config: | ||
security: | ||
protected_customvars: "*pw*,*pass*,community" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Role icinga.icinga.icingaweb2 | ||
|
||
The role icingaweb2 installs and configures Icinga Web 2 and its modules. | ||
|
||
### Modules | ||
* [Director](./module-director.md) | ||
* [IcingaDB](./module-icingadb.md) | ||
* [Monitoring](./module-monitoring.md) | ||
|
||
## Variables | ||
|
||
### Icinga Web 2 DB Configuration | ||
|
||
If you use this configuration it will be your main Icinga Web DB, this means if the variable `icingaweb2_db_import_schema` is used the schema will be imported to this database. | ||
|
||
``` | ||
icingaweb2_db: | ||
type: mysql | ||
name: icingaweb | ||
host: 127.0.0.1 | ||
user: icingaweb | ||
password: icingaweb | ||
``` | ||
|
||
* `icingaweb2_db_import_schema: boolean` | ||
* Decides whether the schema should be imported in the database defined at `icingaweb2_db`. **Default: False** | ||
|
||
* `icingaweb2_admin_<username|password>: string` | ||
* Set the username and password for the first admin user for Icinga Web 2. | ||
|
||
#### Resources | ||
|
||
Besides the standard Icinga Web 2 database you may configure additional resources for IcingaDB or automated imports. | ||
|
||
``` | ||
icingaweb2_resources: | ||
icinga_ido: | ||
type: db | ||
db: mysql | ||
host: localhost | ||
dbname: icinga | ||
username: icinga | ||
password: icinga | ||
use_ssl: 0 | ||
charset: utf8 | ||
my_ldap: | ||
type: ldap | ||
[...] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
collections: | ||
- name: community.docker | ||
version: ">=1.9.0,<2.0.0" | ||
- name: community.general | ||
version: ">=2,<3" | ||
- name: community.mysql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
- name: Converge | ||
hosts: all | ||
become: true | ||
vars: | ||
icingaweb2_resources: | ||
director_db: | ||
type: db | ||
db: mysql | ||
host: localhost | ||
dbname: directordb | ||
username: directordb | ||
password: directordb | ||
charset: utf8 | ||
icinga_ido: | ||
type: db | ||
db: mysql | ||
host: localhost | ||
dbname: icinga | ||
username: icinga | ||
password: icinga | ||
use_ssl: 0 | ||
charset: utf8 | ||
icingaweb2_modules: | ||
director: | ||
enabled: true | ||
source: package | ||
import_schema: true | ||
run_kickstart: true | ||
kickstart: | ||
config: | ||
endpoint: "{{ ansible_fqdn }}" | ||
host: 127.0.0.1 | ||
username: root | ||
password: root | ||
config: | ||
db: | ||
resource: director_db | ||
icingadb: | ||
enabled: true | ||
source: package | ||
commandtransports: | ||
instance01: | ||
transport: api | ||
host: 127.0.0.1 | ||
username: root | ||
password: root | ||
config: | ||
icingadb: | ||
resource: icingadb | ||
redis: | ||
tls: '0' | ||
redis: | ||
redis1: | ||
host: "192.168.56.200" | ||
redis2: | ||
host: "192.168.56.201" | ||
monitoring: | ||
enabled: false | ||
backends: | ||
icinga2_ido_mysql: | ||
type: ido | ||
resource: icinga_ido | ||
icingaweb2_roles: | ||
my_admins: | ||
users: | ||
- blubber | ||
- robby | ||
permissions: | ||
- "config/*" | ||
- "module/monitoring" | ||
- "monitoring/commands/schedule-check" | ||
'monitoring/filter/objects': "host_name=*win*" | ||
icingaweb2_db: | ||
type: mysql | ||
name: icingaweb | ||
host: 127.0.0.1 | ||
user: icingaweb | ||
password: icingaweb | ||
icingaweb2_admin_username: admin | ||
icingaweb2_admin_password: admin | ||
icingaweb2_db_import_schema: true | ||
icingadb_database_import_schema: true | ||
mysql_innodb_file_format: barracuda | ||
mysql_innodb_large_prefix: 1 | ||
mysql_innodb_file_per_table: 1 | ||
mysql_packages: | ||
- mariadb-client | ||
- mariadb-server | ||
- python3-mysqldb | ||
mysql_users: | ||
- name: directordb | ||
host: "%" | ||
password: directordb | ||
priv: "directordb.*:ALL" | ||
- name: icingadb | ||
host: "%" | ||
password: icingadb | ||
priv: "icingadb.*:ALL" | ||
- name: icingaweb | ||
host: "%" | ||
password: icingaweb | ||
priv: "icingaweb.*:ALL" | ||
- name: icinga | ||
host: "%" | ||
password: icinga | ||
priv: "icinga.*:ALL" | ||
mysql_databases: | ||
- name: icingaweb | ||
- name: icinga | ||
- name: directordb | ||
- name: icingadb | ||
collation: utf8mb4_general_ci | ||
encoding: utf8mb4 | ||
icinga2_confd: true | ||
icinga2_features: | ||
- name: perfdata | ||
host_perfdata_path: "/var/spool/icinga2/perfdata/host-perfdata" | ||
service_perfdata_path: "/var/spool/icinga2/perfdata/service-perfdata" | ||
- name: gelf | ||
host: localhost | ||
port: 12201 | ||
- name: elasticsearch | ||
host: localhost | ||
port: 9200 | ||
index: "icinga2" | ||
enable_send_perfdata: true | ||
flush_interval: 10 | ||
flush_threshold: 1024 | ||
- name: opentsdb | ||
host: localhost | ||
port: 4242 | ||
- name: icingadb | ||
host: 127.0.0.1 | ||
- name: idomysql | ||
host: localhost | ||
database: icinga | ||
user: icinga | ||
password: icinga | ||
import_schema: true | ||
- name: notification | ||
- name: checker | ||
- name: influxdb2 | ||
host: 127.0.0.1 | ||
port: 8086 | ||
organization: monitoring | ||
bucket: icinga2 | ||
auth_token: testtoken123 | ||
- name: mainlog | ||
- name: api | ||
ca_host: none | ||
endpoints: | ||
- name: "{{ ansible_fqdn }}" | ||
zones: | ||
- name: "main" | ||
endpoints: | ||
- "{{ ansible_fqdn }}" | ||
icinga2_config_directories: | ||
- zones.d/main/commands | ||
- zones.d/main/hosts | ||
- zones.d/main/services | ||
collections: | ||
- icinga.icinga | ||
roles: | ||
- repos | ||
- geerlingguy.mysql | ||
- icinga2 | ||
- icingaweb2 |
Oops, something went wrong.