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 has been created by Ansible | |
object Service "disk" { | |
import "generic-service" | |
check_command = "disk" | |
host_name = "{{ hostitem }}" | |
} |
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
object Zone "global-templates" { | |
global = true | |
} | |
object Endpoint "{{ master_hostname }}" { | |
host = "{{ master_hostname }}" | |
} | |
object Zone "{{ master_hostname }}" { | |
endpoints = [ "{{ master_hostname }}" ] |
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
object Host "{{ hostitem }}" { | |
import "generic-host" | |
check_command = "hostalive" | |
address = "{{ hostvars[hostitem]['icinga_addr'] }}" | |
address6 = "{{ hostvars[hostitem]['icinga_addr6'] }}" | |
vars.os = "Linux" | |
zone = "MASTERFQDN" | |
} |
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
--- | |
# | |
# Setting up the Icinga2 PKI is derived from https://monitoring-portal.org/index.php?thread/35989-using-ansible-to-generate-the-icinga-client-certificates/ | |
# | |
- hosts: MASTERFQDN | |
tasks: | |
- name: generate ticket on the icinga master and save it as a variable | |
shell: /usr/sbin/icinga2 pki ticket --cn {{ hostitem }} | |
register: ticket | |
- hosts: "{{ hostitem }}" |