-
-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revoke command missing on easy-rsa 3.0 #331 #332
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,10 +25,40 @@ | |
|
||
$etc_directory = $openvpn::etc_directory | ||
|
||
exec { "revoke certificate for ${name} in context of ${server}": | ||
command => ". ./vars && ./revoke-full ${name}; echo \"exit $?\" | grep -qE '(error 23|exit (0|2))' && touch revoked/${name}", | ||
cwd => "${etc_directory}/openvpn/${server}/easy-rsa", | ||
creates => "${etc_directory}/openvpn/${server}/easy-rsa/revoked/${name}", | ||
provider => 'shell', | ||
case $openvpn::easyrsa_version { | ||
'2.0': { | ||
exec { "revoke certificate for ${name} in context of ${server}": | ||
command => ". ./vars && ./revoke-full ${name}; echo \"exit $?\" | grep -qE '(error 23|exit (0|2))' && touch revoked/${name}", | ||
cwd => "${etc_directory}/openvpn/${server}/easy-rsa", | ||
creates => "${etc_directory}/openvpn/${server}/easy-rsa/revoked/${name}", | ||
provider => 'shell', | ||
} | ||
} | ||
'3.0': { | ||
if $openvpn::manage_service { | ||
if $facts['service_provider'] == 'systemd' { | ||
$lnotify = Service["openvpn@${server}"] | ||
} elsif $openvpn::namespecific_rclink { | ||
$lnotify = Service["openvpn_${server}"] | ||
} else { | ||
$lnotify = Service['openvpn'] | ||
Openvpn::Server[$server] -> Service['openvpn'] | ||
} | ||
} | ||
else { | ||
$lnotify = undef | ||
} | ||
|
||
exec { "revoke certificate for ${name} in context of ${server}": | ||
command => ". ./vars && echo yes | ./easyrsa revoke ${name} 2>&1 | grep -E 'Already revoked|was successful|not a valid certificate' && ./easyrsa gen-crl && /bin/cp -f keys/crl.pem ../crl.pem && touch revoked/${name}", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. May I ask, why you are using 'echo yes' instead of the --batch switch on easyrsa? I just hacked together a 'revoke-full' temp fix and found this to be simpler. Cheers, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No reason, just missed that flag. |
||
cwd => "/etc/openvpn/${server}/easy-rsa", | ||
creates => "/etc/openvpn/${server}/easy-rsa/revoked/${name}", | ||
provider => 'shell', | ||
notify => $lnotify, | ||
} | ||
} | ||
default: { | ||
fail("unexepected value for EasyRSA version, got '${openvpn::easyrsa_version}', expect 2.0 or 3.0.") | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit annoying that this is so ugly to automate :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree 100%!!!!!! I was not very happy to find that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is why acceptance tests are mandatory IMO. This will permit to check if it is not too much fragile.