ensure that links and hashes are properly created
[mirror/dsa-puppet.git] / modules / ssl / manifests / service.pp
index d562af8..ef7d74a 100644 (file)
@@ -1,4 +1,4 @@
-define ssl::service($ensure = present, $tlsaport = 443) {
+define ssl::service($ensure = present, $tlsaport = 443, $notify = []) {
        $link_target = $ensure ? {
                present => link,
                absent  => absent,
@@ -7,11 +7,16 @@ define ssl::service($ensure = present, $tlsaport = 443) {
 
        file { "/etc/ssl/debian/certs/$name.crt":
                source => "puppet:///modules/ssl/servicecerts/${name}.crt",
-               notify => Exec['c_rehash /etc/ssl/debian/certs'],
+               notify => [ Exec['c_rehash /etc/ssl/debian/certs'], $notify ],
+       }
+       file { "/etc/ssl/debian/certs/$name.crt-chain":
+               source => [ "puppet:///modules/ssl/chains/${name}.crt", "puppet:///modules/ssl/servicecerts/${name}.crt" ],
+               notify => [ Exec['c_rehash /etc/ssl/debian/certs'], $notify ],
+               links => follow,
        }
 
        if $tlsaport > 0 {
-               dnsextras::tlsa_record{ "tlsa-${tlsaport}":
+               dnsextras::tlsa_record{ "tlsa-${name}-${tlsaport}":
                        zone => 'debian.org',
                        certfile => "/etc/puppet/modules/ssl/files/servicecerts/${name}.crt",
                        port => $tlsaport,