diff --git a/manifests/icinga2/apt_config.pp b/manifests/icinga2/apt_config.pp new file mode 100644 index 0000000..9b8f4d5 --- /dev/null +++ b/manifests/icinga2/apt_config.pp @@ -0,0 +1,17 @@ +# Icinga2 APT configuration +class profile::icinga2::apt_config { + $mirror = hiera('icinga2::apt_config::mirror') + $keyid = hiera('icinga2::apt_config::keyid') + $key = hiera('icinga2::apt_config::key') + + apt::source { 'icinga-stable-release': + location => $mirror, + release => "icinga-${::lsbdistcodename}", + repos => 'main', + key => { + id => $keyid, + content => $key, + }, + include_src => false, + } +} diff --git a/manifests/icinga2/master.pp b/manifests/icinga2/master.pp new file mode 100644 index 0000000..5e1242a --- /dev/null +++ b/manifests/icinga2/master.pp @@ -0,0 +1,26 @@ +# An icinga master host +class profile::icinga2::master { + $zonename = hiera('icinga2::zonename') + $zones = hiera('icinga2::zones') + $endpoints = hiera('icinga2::endpoints') + + include profile::icinga2::apt_config + + class {'::icinga2': + confd => false, + features => ['checker', 'mainlog', 'notification', 'statusdata', 'compatlog', 'command'], + constants => { + 'ZoneName' => $zonename, + }, + } + + class { 'icinga2::feature::api': + accept_commands => true, + endpoints => $endpoints, + zones => $zones, + } + + icinga2::object::zone { 'global-templates': + global => true, + } +}