summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Dittberner <jandd@cacert.org>2019-07-21 13:59:03 +0200
committerJan Dittberner <jandd@cacert.org>2019-07-21 13:59:03 +0200
commitce7a64306015bfab03666068ce1407cf0195d693 (patch)
treeb3b88d49dfc86962bb531edcf060f8b6a8b6c6b0
parent7acdbe410bc6ab956272c701459a120e04e306c2 (diff)
downloadcacert-puppet-ce7a64306015bfab03666068ce1407cf0195d693.tar.gz
cacert-puppet-ce7a64306015bfab03666068ce1407cf0195d693.tar.xz
cacert-puppet-ce7a64306015bfab03666068ce1407cf0195d693.zip
Add exported zone and endpoint for icinga2 agent
-rw-r--r--Puppetfile1
-rw-r--r--sitemodules/profiles/manifests/icinga2_agent.pp14
2 files changed, 15 insertions, 0 deletions
diff --git a/Puppetfile b/Puppetfile
index b11528e..e37aa46 100644
--- a/Puppetfile
+++ b/Puppetfile
@@ -1,3 +1,4 @@
+mod 'icinga/icinga2'
mod 'puppetlabs/apt'
mod 'puppetlabs/mailalias_core'
mod 'puppetlabs/stdlib'
diff --git a/sitemodules/profiles/manifests/icinga2_agent.pp b/sitemodules/profiles/manifests/icinga2_agent.pp
index fbb2dc7..9b4fec5 100644
--- a/sitemodules/profiles/manifests/icinga2_agent.pp
+++ b/sitemodules/profiles/manifests/icinga2_agent.pp
@@ -55,4 +55,18 @@ class profiles::icinga2_agent (
],
}
Exec['/bin/sh /var/lib/icinga2/setup_agent.sh'] ~> Service<| name == 'icinga2' |>
+
+ @@icinga2::object::endpoint {
+ ensure => present,
+ endpoint_name => $::fqdn,
+ target => "/etc/icinga2/zones.d/${::fqdn}.conf",
+ }
+
+ @@icinga2::object::zone {
+ ensure => present,
+ zone_name => $::fqdn,
+ endpoints => [$::fqdn],
+ parent => $::profiles::icinga2_common::master_host,
+ target => "/etc/icinga2/zones.d/${::fqdn}.conf",
+ }
}