diff options
author | elijah <elijah@riseup.net> | 2016-07-21 12:13:33 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2016-07-21 12:13:33 -0700 |
commit | 2df23a682b9a1a99502c79d7112dcefeecf63619 (patch) | |
tree | 80b3acab77cad9323f21bad035f31f660fad8ddd /puppet/modules/openvpn/manifests/option.pp | |
parent | d6719731dce8ee7e048a16a447a426abcaa44f24 (diff) |
git subrepo clone https://leap.se/git/puppet_openvpn puppet/modules/openvpn
subrepo:
subdir: "puppet/modules/openvpn"
merged: "ba7ec7a"
upstream:
origin: "https://leap.se/git/puppet_openvpn"
branch: "master"
commit: "ba7ec7a"
git-subrepo:
version: "0.3.0"
origin: "https://github.com/ingydotnet/git-subrepo"
commit: "cb2995b"
Diffstat (limited to 'puppet/modules/openvpn/manifests/option.pp')
-rw-r--r-- | puppet/modules/openvpn/manifests/option.pp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/puppet/modules/openvpn/manifests/option.pp b/puppet/modules/openvpn/manifests/option.pp new file mode 100644 index 00000000..eb3d5a72 --- /dev/null +++ b/puppet/modules/openvpn/manifests/option.pp @@ -0,0 +1,24 @@ +# option.pp + +define openvpn::option($key, $server, $value = '', $client = '', $csc = false) { + $content = $value ? { + '' => $key, + default => "${key} ${value}" + } + + if $client == '' { + $path = "/etc/openvpn/${server}.conf" + } else { + if $csc { + $path = "/etc/openvpn/${server}/client-configs/${client}" + } else { + $path = "/etc/openvpn/${server}/download-configs/${client}/${client}.conf" + } + } + + concat::fragment { + "openvpn.${server}.${client}.${name}": + target => $path, + content => "${content}\n"; + } +} |