Skip to content

Commit

Permalink
add param validation to nsstools::add_cert
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Hoblitt committed Feb 13, 2014
1 parent c4d4c89 commit 7bb1565
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions manifests/add_cert.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
#
# Sample Usage:
#
# nsstools::add_cert { '/tmp/server.crt':
# nickname => 'GlobalSign Root CA',
# certdir => '/etc/pki/foo',
# }
# nsstools::add_cert { '/tmp/server.crt':
# nickname => 'GlobalSign Root CA',
# certdir => '/etc/pki/foo',
# }
#
#
define nsstools::add_cert(
$certdir,
Expand All @@ -28,6 +29,11 @@
) {
include nsstools

validate_absolute_path($certdir)
validate_absolute_path($cert)
validate_string($nickname)
validate_string($trustargs)

exec { "add_cert_${title}":
path => ['/usr/bin'],
command => "certutil -d ${certdir} -A -n '${nickname}' -t '${trustargs}' -a -i ${cert}",
Expand Down

0 comments on commit 7bb1565

Please sign in to comment.