diff options
author | Jan Dittberner <jandd@cacert.org> | 2019-07-21 12:01:36 +0200 |
---|---|---|
committer | Jan Dittberner <jandd@cacert.org> | 2019-07-21 12:01:36 +0200 |
commit | 7adaa98e8cc8a31c2856cf2652c1467197b86ac0 (patch) | |
tree | 1043d978e471c768930ac8e855a9383251032e16 | |
parent | b01109a8a8b7943d155c91fb5686b999b4fb1480 (diff) | |
download | cacert-puppet-7adaa98e8cc8a31c2856cf2652c1467197b86ac0.tar.gz cacert-puppet-7adaa98e8cc8a31c2856cf2652c1467197b86ac0.tar.xz cacert-puppet-7adaa98e8cc8a31c2856cf2652c1467197b86ac0.zip |
Prepare icinga2_agent installation on puppet
-rw-r--r-- | hieradata/common.yaml | 1 | ||||
-rw-r--r-- | sitemodules/profiles/manifests/icinga2_agent.pp | 18 | ||||
-rw-r--r-- | sitemodules/profiles/templates/icinga2_agent/setup_agent.sh.epp | 4 | ||||
-rw-r--r-- | sitemodules/roles/manifests/puppetmaster.pp | 4 |
4 files changed, 11 insertions, 16 deletions
diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 8239ac2..c9cf534 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -142,7 +142,6 @@ profiles::icinga2_agent::pki_api_password: > gCG3gDAX0FOzW/oWi8c1PDIFb+0B4cTQRi9gP2fzugKu0bp0FBB7akZV6Zx0 T5GP0WQAzU0=] profiles::icinga2_agent::master_host: monitor.infra.cacert.org -profiles::icinga2_agent::master_ip: 10.0.0.18 profiles::icinga2_common::ca_certificate: | -----BEGIN CERTIFICATE----- MIIEyjCCArKgAwIBAgIVAMGxGJbZJq/vXMuXAnAC8QvFtvhMMA0GCSqGSIb3DQEB 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 } |