Certmonger: Only notify haproxy class if it's defined
authorJuan Antonio Osorio Robles <jaosorior@redhat.com>
Wed, 1 Nov 2017 15:59:59 +0000 (17:59 +0200)
committerEmilien Macchi <emilien@redhat.com>
Sat, 4 Nov 2017 05:23:26 +0000 (05:23 +0000)
The haproxy certmonger resource (which requests the HAProxy certs)
expected the haproxy puppet manifests to run alongside if we're using a
local CA. This is no longer the case in containerized environments, e.g.
the containerized undercloud. This makes that optional.

Change-Id: I2764ca1674dcd5ecd7886233bb5e9795ee697be3
(cherry picked from commit abd7a9486d8fb5cad7f6f0b48a466597f1d1bf71)

manifests/certmonger/haproxy.pp

index 97efe59..cff9f34 100644 (file)
@@ -63,8 +63,9 @@ define tripleo::certmonger::haproxy (
     # This is only needed for certmonger's local CA. For any other CA this
     # operation (trusting the CA) should be done by the deployer.
     if $certmonger_ca == 'local' {
-      class { '::tripleo::certmonger::ca::local':
-        notify => Class['::tripleo::haproxy']
+      include ::tripleo::certmonger::ca::local
+      if defined(Class['::haproxy']) {
+        Class['::tripleo::certmonger::ca::local'] ~> Class['::haproxy']
       }
     }