Try to replace file access to auto-ca things with templates
[mirror/dsa-puppet.git] / modules / stunnel4 / manifests / client.pp
index b13e3d4..e34cb10 100644 (file)
@@ -3,8 +3,11 @@ define stunnel4::client($accept, $connecthost, $connectport) {
        include stunnel4
 
        file { "/etc/stunnel/puppet-${name}-peer.pem":
-               content => generate('/bin/cat', "/etc/puppet/modules/ssl/files/auto-certs/${connecthost}.crt",
-                       '/etc/puppet/modules/ssl/files/auto-certs/ca.crt'),
+               content => inline_template( @("EOF"),
+                                               <%= File.read(scope().call_function("hiera", ["paths.auto_certs_dir"]) + "/" + @connecthost + ".crt") %>
+                                               <%= File.read(scope().call_function("hiera", ["paths.auto_certs_dir"]) + "/ca.crt") %>
+                                               | EOF
+                                       ),
                notify  => Exec["restart_stunnel_${name}"],
        }