update module to use concat instead of concatfilepart
[puppet_openvpn.git] / manifests / option.pp
1 # option.pp
2
3 define openvpn::option($key, $value = "", $server, $client = "", $csc = false) {
4     $content = $value ? {
5         ""      => "${key}",
6         default => "${key} ${value}"
7     }
8
9     if $client == "" {
10         $path = "/etc/openvpn/${server}.conf"
11     } else {
12         if $csc {
13             $path = "/etc/openvpn/${server}/client-configs/${client}"
14         } else {
15             $path = "/etc/openvpn/${server}/download-configs/${client}/${client}.conf"
16         }
17     }
18
19     concat::fragment {
20         "openvpn.${server}.${client}.${name}":
21             target  => $path,
22             content => "${content}\n";
23     }
24 }