diff options
author | Johan Lundberg <lundberg@nordu.net> | 2015-04-22 12:57:43 +0200 |
---|---|---|
committer | Johan Lundberg <lundberg@nordu.net> | 2015-04-22 12:57:43 +0200 |
commit | 4b9cf9c80c5850a7b6dd77759bb73e51e8cbdaa7 (patch) | |
tree | 3963feb9674392f755b96e5856beb857a6c354e2 /global/overlay/etc/puppet/manifests/cosmos-site.pp | |
parent | 5e239681e344d938ef86eeec35d5755d4f9b2aac (diff) |
Added nagioshost class.
Diffstat (limited to 'global/overlay/etc/puppet/manifests/cosmos-site.pp')
-rw-r--r-- | global/overlay/etc/puppet/manifests/cosmos-site.pp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/global/overlay/etc/puppet/manifests/cosmos-site.pp b/global/overlay/etc/puppet/manifests/cosmos-site.pp index a9603a5..e471544 100644 --- a/global/overlay/etc/puppet/manifests/cosmos-site.pp +++ b/global/overlay/etc/puppet/manifests/cosmos-site.pp @@ -50,6 +50,41 @@ class mailclient ($domain) { cosmos::preseed::preseed_package {"postfix": ensure => present, domain => $domain} } +class nagioshost { + + $nagios_ip_v4 = hiera('nagios_ip_v4', '109.105.111.111'), + $nagios_ip_v6 = hiera('nagios_ip_v6', '2001:948:4:6::111'), + $allowed_hosts = "${nagios_ip_v4},${nagios_ip_v6}", + + package {'nagios-nrpe-server': + ensure => 'installed', + } -> + file { "/etc/nagios/nrpe.cfg" : + ensure => 'file', + mode => '0640', + group => 'nagios', + content => template('sunet/nagioshost/nrpe.cfg.erb'), + } -> + file { "/usr/lib/nagios/plugins/check_uptime.pl" : + ensure => 'file', + mode => '0640', + group => 'nagios', + content => template('sunet/nagioshost/check_uptime.pl.erb'), + } -> + ufw::allow { "allow-nrpe-v4": + from => "${nagios_ip_v4}", + ip => 'any', + proto => 'tcp', + port => 5666 + } -> + ufw::allow { "allow-nrpe-v6": + from => "${nagios_ip_v6}", + ip => 'any', + proto => 'tcp', + port => 5666 + } +} + node 'sto-tug-kvm1.swamid.se' { package {'python-vm-builder': |