Skip to content

Commit

Permalink
Merge pull request #89 from fastlorenzo/master
Browse files Browse the repository at this point in the history
Added possiblility to set the up/down script for client
  • Loading branch information
luxflux committed Aug 24, 2014
2 parents 2096278 + 92d8924 commit 9100096
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
10 changes: 9 additions & 1 deletion manifests/client.pp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@
# style attack from a malicious or compromised server.
# Default: {}
#
# [*up*]
# String, Script which we want to run when openvpn client is connecting
#
# [*down*]
# String, Script which we want to run when openvpn client is disconneting
#
# === Examples
#
# openvpn::client {
Expand Down Expand Up @@ -147,7 +153,9 @@
$cipher = '',
$authuserpass = false,
$setenv = {},
$setenv_safe = {}
$setenv_safe = {},
$up = '',
$down = '',
) {

if $pam {
Expand Down
9 changes: 9 additions & 0 deletions templates/client.erb
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,12 @@ setenv <%= key %> <%= value %>
<% scope.lookupvar('setenv_safe').each do |key, value| -%>
setenv_safe <%= key %> <%= value %>
<% end -%>
<% if scope.lookupvar('up') != '' or scope.lookupvar('down') != ''-%>
script-security 2
<% end -%>
<% if scope.lookupvar('up') != '' -%>
up "<%= scope.lookupvar('up') %>"
<% end -%>
<% if scope.lookupvar('down') != '' -%>
down "<%= scope.lookupvar('down') %>"
<% end -%>

0 comments on commit 9100096

Please sign in to comment.