aboutsummaryrefslogtreecommitdiff
path: root/roles/icinga2
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2022-01-25 12:40:10 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2022-01-25 12:40:10 +0100
commitbc267001fd61124c4752abe58d65d5f13dac9f5d (patch)
tree03a51a103021e8a3ec4b9f8950cf143a9928b5e6 /roles/icinga2
parent1c7ffdae0fa70e066dee294e11bc7569c429c321 (diff)
downloadansible_collection-bc267001fd61124c4752abe58d65d5f13dac9f5d.tar.gz
icinga: add contsants
Diffstat (limited to 'roles/icinga2')
-rw-r--r--roles/icinga2/Readme.md38
-rw-r--r--roles/icinga2/defaults/main.yml11
-rw-r--r--roles/icinga2/tasks/icinga.yml1
-rw-r--r--roles/icinga2/templates/constants.conf.j210
4 files changed, 55 insertions, 5 deletions
diff --git a/roles/icinga2/Readme.md b/roles/icinga2/Readme.md
index 05969c7..6f7be6d 100644
--- a/roles/icinga2/Readme.md
+++ b/roles/icinga2/Readme.md
@@ -1,6 +1,8 @@
# icinga2
-Installs Icinga2 Monitor standalone node and Icingaweb2 with integrated MariaDB Databse
+Installs Icinga2 Monitor standalone node and Icingaweb2 with integrated MariaDB Database.
+
+Als configures postfix to relay specific mails to SMTP gateway
Default settings
@@ -9,16 +11,39 @@ Default settings
icinga_ido_db_pw: 'changeme'
icinga_web_db_pw: 'changeme'
+
icinga:
# icingaweb2 api user is created automatically with random password
api_users:
- name: 'test'
password: 'changeme'
permissions: '[ ]'
+ # CN MUST match FQDN
+ api_cert:
+ crt: '/etc/ssl/cert/ssl-cert-snakeoil.pem'
+ key: '/etc/ssl/private/ssl-cert-snakeoil.key'
+ ca: '/etc/ssl/certs/ca-certificates.crt'
+ config:
+ manage: false
+ git_url: ''
+ git_version: 'mainu'
+ mail:
+ enable: false
+ smtp_host: 'smtp.example.com'
+ smtp_port: '25'
+ smtp_user: ''
+ smtp_psw: ''
+ from: ''
+ constants:
+ TicketSalt: ''
+ NodeName: '{{ ansible_facts.fqdn }}'
+ ZoneName: '{{ ansible_facts.fqdn }}'
+ PluginDir: '/usr/lib/nagios/plugins'
+ ManubulonPluginDir: '/usr/lib/nagios/plugins'
+ PluginContribDir: '/usr/lib/nagios/plugins'
icingaweb:
cert:
- use_ssl: true
cert: '/etc/ssl/cert/ssl-cert-snakeoil.pem'
key: '/etc/ssl/private/ssl-cert-snakeoil.key'
ldap:
@@ -35,7 +60,8 @@ icingaweb:
filter: ''
groups:
base_dn: ''
- group_member_attribute: 'cn'
+ group_member_attribute: 'member'
+ group_name_attribute: 'cn'
group_class: 'groupOfNames'
group_filter: 'cn=*'
user_base_dn: ''
@@ -48,4 +74,10 @@ icingaweb:
groups: 'Administrators'
enabled_modules:
- monitoring
+ - businessprocess
+ install_modules:
+ businessprocess:
+ url: 'https://github.com/Icinga/icingaweb2-module-businessprocess'
+ version: 'master'
+
```
diff --git a/roles/icinga2/defaults/main.yml b/roles/icinga2/defaults/main.yml
index 0c36ee6..7e4e5bc 100644
--- a/roles/icinga2/defaults/main.yml
+++ b/roles/icinga2/defaults/main.yml
@@ -17,7 +17,7 @@ icinga:
config:
manage: false
git_url: ''
- git_branch: 'mainu'
+ git_version: 'mainu'
mail:
enable: false
smtp_host: 'smtp.example.com'
@@ -25,6 +25,13 @@ icinga:
smtp_user: ''
smtp_psw: ''
from: ''
+ constants:
+ TicketSalt: ''
+ NodeName: '{{ ansible_facts.fqdn }}'
+ ZoneName: '{{ ansible_facts.fqdn }}'
+ PluginDir: '/usr/lib/nagios/plugins'
+ ManubulonPluginDir: '/usr/lib/nagios/plugins'
+ PluginContribDir: '/usr/lib/nagios/plugins'
icingaweb:
cert:
@@ -49,7 +56,7 @@ icingaweb:
group_class: 'groupOfNames'
group_filter: 'cn=*'
user_base_dn: ''
- user_class: 'posixAccount'
+ user_class: 'inetOrgPerson'
user_name_attribute: 'uid'
roles:
- name: Administrators
diff --git a/roles/icinga2/tasks/icinga.yml b/roles/icinga2/tasks/icinga.yml
index 7acbb47..239b5e2 100644
--- a/roles/icinga2/tasks/icinga.yml
+++ b/roles/icinga2/tasks/icinga.yml
@@ -46,6 +46,7 @@
loop:
- ido-mysql.conf
- api_users.conf
+ - constants.conf
- name: Install config from git
git:
diff --git a/roles/icinga2/templates/constants.conf.j2 b/roles/icinga2/templates/constants.conf.j2
new file mode 100644
index 0000000..18e8e90
--- /dev/null
+++ b/roles/icinga2/templates/constants.conf.j2
@@ -0,0 +1,10 @@
+/**
+* vi: ft=icinga2
+* This File is managed by Ansible. Do NOT change.
+*/
+
+{% for const in icinga.constants %}
+
+const {{ const }} = "{{ icinga.constants[ const ] }}"
+
+{% endfor %}