Skip to content

Instantly share code, notes, and snippets.

@lazyfrosch
Last active April 22, 2016 05:36
Show Gist options
  • Save lazyfrosch/5deef1cea45e876ef97d to your computer and use it in GitHub Desktop.
Save lazyfrosch/5deef1cea45e876ef97d to your computer and use it in GitHub Desktop.
Icinga 2 Puppet module example
include ::profile::icinga2_global
# endpoints will be generated from zone
# no host value, so the agent will connect to the master
@@::icinga2::object::zone { $::fqdn:
parent => 'master',
endpoints => {
$::fqdn => {
},
},
}
# collect myself
Icinga2::Object::Zone <<| title == $::fqdn |>>
include ::icinga2
include ::icinga2::pki::puppet
class { 'icinga2::feature::api':
accept_commands => true,
accept_config => true,
manage_zone => false,
}
::icinga2::object::zone { 'global-templates':
global => true,
}
# this is in all catalogs (without exported resource)
::icinga2::object::zone { 'master':
endpoints => {
'icinga1.example.com' => {
host => '1.2.3.4',
},
},
}
include ::profile::icinga2_global
include ::icinga2::feature::command
class { 'icinga2::feature::ido_mysql':
user => 'icinga2',
password => 'foooobar',
}
# collect all other zones
# note: only agent zones
Icinga2::Object::Zone <<| |>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment