Try to improve icinga agent profile
authorJan Dittberner <jandd@cacert.org>
Sun, 28 Jul 2019 17:48:59 +0000 (19:48 +0200)
committerJan Dittberner <jandd@cacert.org>
Sun, 28 Jul 2019 17:48:59 +0000 (19:48 +0200)
Enforce order of master certificate installation to avoid issues with
certificate enrollment during API activation.

sitemodules/profiles/manifests/icinga2_agent.pp

index 6300301..0c61ffa 100644 (file)
@@ -37,7 +37,9 @@ class profiles::icinga2_agent (
 ) {
   include 'profiles::icinga2_common'
 
-  file { "/var/lib/icinga2/certs/trusted-cert.crt":
+  $icinga_master_cert = '/var/lib/icinga2/certs/trusted-cert.crt'
+
+  file { $icinga_master_cert:
     ensure  => file,
     content => $master_certificate,
     owner   => 'nagios',
@@ -73,6 +75,7 @@ class profiles::icinga2_agent (
         'endpoints' => [$master_host],
       },
     },
+    require         => File[$icinga_master_cert],
   }
 
   icinga2::object::zone { 'global-templates':