Skip to content

Instantly share code, notes, and snippets.

object Host "{{ hostitem }}" {
import "generic-host"
check_command = "hostalive"
address = "{{ hostvars[hostitem]['icinga_addr'] }}"
address6 = "{{ hostvars[hostitem]['icinga_addr6'] }}"
vars.os = "Linux"
zone = "MASTERFQDN"
}
object Zone "global-templates" {
global = true
}
object Endpoint "{{ master_hostname }}" {
host = "{{ master_hostname }}"
}
object Zone "{{ master_hostname }}" {
endpoints = [ "{{ master_hostname }}" ]
// This file has been created by Ansible
object Service "disk" {
import "generic-service"
check_command = "disk"
host_name = "{{ hostitem }}"
}
@frootmig
frootmig / deploy-icinga-agent.yml
Created March 25, 2017 13:05
Deploy Icinga 2 satellite and add it to master
---
#
# 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 }}"