summaryrefslogtreecommitdiff
path: root/sitemodules
diff options
context:
space:
mode:
authorJan Dittberner <jandd@cacert.org>2019-07-21 12:01:36 +0200
committerJan Dittberner <jandd@cacert.org>2019-07-21 12:01:36 +0200
commit7adaa98e8cc8a31c2856cf2652c1467197b86ac0 (patch)
tree1043d978e471c768930ac8e855a9383251032e16 /sitemodules
parentb01109a8a8b7943d155c91fb5686b999b4fb1480 (diff)
downloadcacert-puppet-7adaa98e8cc8a31c2856cf2652c1467197b86ac0.tar.gz
cacert-puppet-7adaa98e8cc8a31c2856cf2652c1467197b86ac0.tar.xz
cacert-puppet-7adaa98e8cc8a31c2856cf2652c1467197b86ac0.zip
Prepare icinga2_agent installation on puppet
Diffstat (limited to 'sitemodules')
-rw-r--r--sitemodules/profiles/manifests/icinga2_agent.pp18
-rw-r--r--sitemodules/profiles/templates/icinga2_agent/setup_agent.sh.epp4
-rw-r--r--sitemodules/roles/manifests/puppetmaster.pp4
3 files changed, 11 insertions, 15 deletions
diff --git a/sitemodules/profiles/manifests/icinga2_agent.pp b/sitemodules/profiles/manifests/icinga2_agent.pp
index 8a0d440..e3402ce 100644
--- a/sitemodules/profiles/manifests/icinga2_agent.pp
+++ b/sitemodules/profiles/manifests/icinga2_agent.pp
@@ -34,7 +34,6 @@ class profiles::icinga2_agent (
String $pki_api_user,
String $pki_api_password,
String $master_host,
- String $master_ip,
) {
include 'profiles::icinga2_common'
file { '/var/lib/icinga2/setup_agent.sh':
@@ -43,18 +42,17 @@ class profiles::icinga2_agent (
pki_api_user => $pki_api_user,
pki_api_password => $pki_api_password,
master_host => $master_host,
- master_ip => $master_ip,
}),
owner => 'nagios',
group => 'nagios',
mode => '0700',
}
- exec { '/bin/sh /var/lib/icinga2/setup_agent.sh':
- creates => "/etc/icinga2/pki/${::fqdn}.key",
- require => [
- File['/var/lib/icinga2/setup_agent.sh'],
- File['/etc/icinga2/pki/ca.crt'],
- Package['icinga2'],
- ],
- }
+ #exec { '/bin/sh /var/lib/icinga2/setup_agent.sh':
+ # creates => "/etc/icinga2/pki/${::fqdn}.key",
+ # require => [
+ # File['/var/lib/icinga2/setup_agent.sh'],
+ # File['/etc/icinga2/pki/ca.crt'],
+ # Package['icinga2'],
+ # ],
+ #}
}
diff --git a/sitemodules/profiles/templates/icinga2_agent/setup_agent.sh.epp b/sitemodules/profiles/templates/icinga2_agent/setup_agent.sh.epp
index c4aef81..20e2132 100644
--- a/sitemodules/profiles/templates/icinga2_agent/setup_agent.sh.epp
+++ b/sitemodules/profiles/templates/icinga2_agent/setup_agent.sh.epp
@@ -1,7 +1,6 @@
<%-| String $pki_api_user,
String $pki_api_password,
String $master_host,
- String $master_ip
|-%>
#!/bin/sh
@@ -10,7 +9,6 @@ set -e
TICKET=$(/usr/bin/curl -f -s --cacert /etc/icinga2/pki/ca.crt \
-u "<%= $pki_api_user %>:<%= $pki_api_password %>" \
-H "Accept: application/json" \
- --resolve "<%= $master_host %>:5665:<%= $master_ip %>" \
"https://<%= $master_host %>:5665/v1/actions/generate-ticket" \
--data '{ "cn": "<%= $::facts["fqdn"] %>" }' | \
/usr/bin/python3 -c \
@@ -18,7 +16,7 @@ TICKET=$(/usr/bin/curl -f -s --cacert /etc/icinga2/pki/ca.crt \
/usr/sbin/icinga2 node setup --ticket "${TICKET}" \
--cn "<%= $::facts["fqdn"] %>" \
---endpoint "<%= $master_host %>,<%= $master_ip %>,5665" \
+--endpoint "<%= $master_host %>" \
--zone "<%= $::facts["fqdn"] %>" \
--parent_zone "<%= $master_host %>" \
--parent_host "<%= $master_host %>" \
diff --git a/sitemodules/roles/manifests/puppetmaster.pp b/sitemodules/roles/manifests/puppetmaster.pp
index 6074c75..74f5986 100644
--- a/sitemodules/roles/manifests/puppetmaster.pp
+++ b/sitemodules/roles/manifests/puppetmaster.pp
@@ -18,12 +18,12 @@
# Copyright
# ---------
#
-# Copyright 2016-2018 Jan Dittberner
+# Copyright 2016-2019 Jan Dittberner
#
class roles::puppetmaster {
include profiles::base
include profiles::rsyslog
include profiles::nrpe_agent
- #include profiles::icinga2_agent
+ include profiles::icinga2_agent
include profiles::puppet_server
}