massive style guide fixups
[mirror/dsa-puppet.git] / modules / stunnel4 / manifests / client.pp
diff --git a/modules/stunnel4/manifests/client.pp b/modules/stunnel4/manifests/client.pp
new file mode 100644 (file)
index 0000000..26945e2
--- /dev/null
@@ -0,0 +1,19 @@
+define stunnel4::client($accept, $connecthost, $connectport) {
+
+       include stunnel4
+
+       file { "/etc/stunnel/puppet-${name}-peer.pem":
+               content => generate('/bin/cat', "/etc/puppet/modules/exim/files/certs/${connecthost}.crt",
+                       '/etc/puppet/modules/exim/files/certs/ca.crt'),
+               notify  => Exec["restart_stunnel_${name}"],
+       }
+
+       stunnel_generic { $name:
+               client  => true,
+               verify  => 3,
+               cafile  => "/etc/stunnel/puppet-${name}-peer.pem",
+               accept  => $accept,
+               connect => "${connecthost}:${connectport}",
+       }
+}
+