aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2012-05-13 01:10:51 -0300
committerSilvio Rhatto <rhatto@riseup.net>2012-05-13 01:10:51 -0300
commit022274e1873b0009eb2a0e5c860b21ebd91d8094 (patch)
treebd303803940e014de621b755c4e4ce102f4b4daa
parentab3599c5972b7f5a96fe45ee1e562331db717efb (diff)
downloadpuppet-ssl-022274e1873b0009eb2a0e5c860b21ebd91d8094.tar.gz
puppet-ssl-022274e1873b0009eb2a0e5c860b21ebd91d8094.tar.bz2
Adding base parameter
-rw-r--r--manifests/init.pp18
1 files changed, 9 insertions, 9 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index c44f231..642e701 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -14,35 +14,35 @@ class ssl {
}
define cert($ensure = present, $owner = 'root', $group = 'root',
- $pubmode = '644', $privmode = '600') {
- file { "/etc/ssl/certs/$name.crt":
+ $pubmode = '644', $privmode = '600', $base = '/etc/ssl') {
+ file { "${base}/certs/$name.crt":
ensure => $ensure,
owner => $owner,
group => $group,
mode => $pubmode,
source => "puppet:///modules/site-keys/ssl/$name.crt",
- require => File["/etc/ssl/certs"],
+ require => File["${base}/certs"],
}
- file { "/etc/ssl/private/$name.pem":
+ file { "${base}/private/$name.pem":
ensure => $ensure,
owner => $owner,
group => $group,
mode => $privmode,
source => "puppet:///modules/site-keys/ssl/$name.pem",
- require => File["/etc/ssl/private"],
+ require => File["${base}/private"],
}
}
- define check($port = '443', $interval = '60', $email = 'root',
- $hour = '0', $minute = '0', $weekday = '0',
- $file = false, $ensure = present) {
+ define check($port = '443', $interval = '60', $email = 'root',
+ $hour = '0', $minute = '0', $weekday = '0',
+ $file = false, $ensure = present, $base = '/etc/ssl') {
$ssl_cert_check = "/usr/local/bin/ssl-cert-check -a -q -x ${interval} -e ${email}"
$command = $file ? {
false => "$ssl_cert_check -s ${name} -p ${port}",
- true => "$ssl_cert_check -c /etc/ssl/certs/cert.crt",
+ true => "$ssl_cert_check -c ${base}/certs/cert.crt",
default => "$ssl_cert_check -c ${file}",
}