diff options
author | Jenkins <jenkins@review.openstack.org> | 2016-11-29 14:51:10 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2016-11-29 14:51:10 +0000 |
commit | 323e556e84a6487afa0034a5c4daf1d908b18f38 (patch) | |
tree | 89cfb557c37edf628694859912f5b1ca6f4d2bfc /manifests | |
parent | 66efa98ba266e8dddcfa1c60cacf6dd9a797e18a (diff) | |
parent | ffd7040a6dcfda59a6768fbe481aba332133e83a (diff) |
Merge "Include local CA in haproxy PEM"
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/certmonger/haproxy.pp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/manifests/certmonger/haproxy.pp b/manifests/certmonger/haproxy.pp index 504acf3..3b8fd09 100644 --- a/manifests/certmonger/haproxy.pp +++ b/manifests/certmonger/haproxy.pp @@ -36,6 +36,10 @@ # The post-save-command that certmonger will use once it renews the # certificate. # +# [*certmonger_ca*] +# (Optional) The CA that certmonger will use to generate the certificates. +# Defaults to hiera('certmonger_ca', 'local'). +# # [*principal*] # The haproxy service principal that is set for HAProxy in kerberos. # @@ -45,7 +49,8 @@ define tripleo::certmonger::haproxy ( $service_key, $hostname, $postsave_cmd, - $principal = undef, + $certmonger_ca = hiera('certmonger_ca', 'local'), + $principal = undef, ){ include ::haproxy::params certmonger_certificate { "${title}-cert": @@ -69,10 +74,21 @@ define tripleo::certmonger::haproxy ( order => '01', require => Certmonger_certificate["${title}-cert"], } + + if $certmonger_ca == 'local' { + $ca_pem = getparam(Class['tripleo::certmonger::ca::local'], 'ca_pem') + concat::fragment { "${title}-ca-fragment": + target => $service_pem, + source => $ca_pem, + order => '10', + require => Class['tripleo::certmonger::ca::local'], + } + } + concat::fragment { "${title}-key-fragment": target => $service_pem, source => $service_key, - order => 10, + order => 20, require => Certmonger_certificate["${title}-cert"], } } |