Update icinga2 server role

This commit is contained in:
Nemo 2020-10-03 15:32:02 +02:00
parent c10b6ab95c
commit 9fc4b7d682
4 changed files with 60 additions and 8 deletions

View file

@ -91,3 +91,6 @@ icinga2_server_ticket_salt: ""
icinga2_server_custom_hostgroup: wirebrass
icinga2_server_nagios_plugins_location: "/usr/lib/nagios/plugins/"
icinga2_server_icinga_ssh_pubkey: ""
icinga2_server_icinga_ssh_privkey: ""

View file

@ -38,3 +38,52 @@
- check_rdns
notify: restart icinga2
- name: Nagios SSH folder created
file:
path: "/home/{{ icinga2_server_user }}/.ssh"
state: directory
owner: "{{ icinga2_server_user }}"
group: "{{ icinga2_server_group }}"
mode: '0755'
- name: Private key to access supervised servers
copy:
dest: "/home/{{ icinga2_server_user }}/.ssh/id_rsa"
owner: "{{ icinga2_server_user }}"
group: "{{ icinga2_server_group }}"
mode: '0600'
content: "{{ icinga2_server_icinga_ssh_privkey }}"
no_log: True
- name: Public key to access supervised servers
copy:
dest: "/home/{{ icinga2_server_user }}/.ssh/id_rsa.pub"
owner: "{{ icinga2_server_user }}"
group: "{{ icinga2_server_group }}"
mode: '0644'
content: "{{ icinga2_server_icinga_ssh_pubkey + '\n' }}"
- name: Icinga2 config hosts folder created
file:
path: "/etc/icinga2/conf.d/hosts"
state: directory
owner: "{{ icinga2_server_user }}"
group: "{{ icinga2_server_group }}"
mode: '0755'
- name: Python DNS module server installed
package:
name: "python-dns"
state: present
- name: Python dnspython module server installed
package:
name: "python-dnspython"
state: present
- name: Icingaweb2 monitoring module folder permissions configured
file:
path: "/usr/share/icingaweb2/modules/monitoring"
state: directory
mode: '0755'

View file

@ -110,7 +110,7 @@ object CheckCommand "by_ssh_wirebrass" {
vars.by_ssh_custom_plugins_path = "{{ icinga2_server_nagios_plugins_location }}"
vars.by_ssh_logname = "nagios"
vars.by_ssh_identity = "/var/lib/icinga2/.ssh/id_rsa"
vars.by_ssh_identity = "/home/nagios/.ssh/id_rsa"
vars.by_ssh_options = [ "ControlMaster=auto","ControlPath=/var/run/icinga2/$host.name$","ControlPersist=10m"]
}

View file

@ -259,13 +259,13 @@ apply Service "procs" {
assign where host.name == NodeName
}
apply Service "swap" {
import "generic-service"
check_command = "swap"
assign where host.name == NodeName
}
#apply Service "swap" {
# import "generic-service"
#
# check_command = "swap"
#
# assign where host.name == NodeName
#}
apply Service "users" {
import "generic-service"