summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Deygas <Vincent.Deygas@rewardgateway.com>2015-01-20 09:31:37 +0000
committerJames Shubin <james@shubin.ca>2015-01-20 05:41:12 -0500
commit30fda96121c6037e3c4d0855f5fdbb713b618035 (patch)
tree9d286c8af8c63ba2f8e8e94c1bcf915075967260
parent8f3bd5670b2ea59067faafbfd7c5246bc01b4004 (diff)
downloadpuppet-gluster-30fda96121c6037e3c4d0855f5fdbb713b618035.zip
puppet-gluster-30fda96121c6037e3c4d0855f5fdbb713b618035.tar.gz
puppet-gluster-30fda96121c6037e3c4d0855f5fdbb713b618035.tar.xz
Added default log directory
-rw-r--r--manifests/mount/base.pp21
-rw-r--r--manifests/params.pp4
2 files changed, 25 insertions, 0 deletions
diff --git a/manifests/mount/base.pp b/manifests/mount/base.pp
index 38bdd85..54fbd42 100644
--- a/manifests/mount/base.pp
+++ b/manifests/mount/base.pp
@@ -24,6 +24,9 @@ class gluster::mount::base(
#$vardir = $::gluster::vardir::module_vardir # with trailing slash
$vardir = regsubst($::gluster::vardir::module_vardir, '\/$', '')
+ $log_short_name = sprintf("%s", regsubst("${::gluster::params::misc_gluster_logs}", '\/$', '')) # no trailing
+ $log_long_name = sprintf("%s/", regsubst("${::gluster::params::misc_gluster_logs}", '\/$', '')) # trailing...
+
# if we use ::mount and ::server on the same machine, this could clash,
# so we use the ensure_resource function to allow identical duplicates!
$rname = "${version}" ? {
@@ -92,6 +95,24 @@ class gluster::mount::base(
# mode => 644, # u=rw,go=r
# ensure => present,
#}
+
+ # ensure parent directories exist for log directory
+ exec { "gluster-log-mkdir-${name}":
+ command => "/bin/mkdir -p '${log_long_name}'",
+ creates => "${log_long_name}",
+ logoutput => on_failure,
+ before => File["${log_long_name}"],
+ }
+
+ # make an empty directory for logs
+ file { "${log_long_name}": # ensure a trailing slash
+ ensure => directory, # make sure this is a directory
+ recurse => false, # don't recurse into directory
+ purge => false, # don't purge unmanaged files
+ force => false, # don't purge subdirs and links
+ alias => "${log_short_name}", # don't allow duplicates name's
+ }
+
}
# vim: ts=8
diff --git a/manifests/params.pp b/manifests/params.pp
index d1113da..98130f2 100644
--- a/manifests/params.pp
+++ b/manifests/params.pp
@@ -63,6 +63,10 @@ class gluster::params(
# external modules...
$include_puppet_facter = true,
+ # Default directories
+ # See http://manpages.ubuntu.com/manpages/trusty/man8/mount.glusterfs.8.html
+ $misc_gluster_logs = '/var/log/glusterfs/',
+
# misc...
$misc_gluster_reload = '/sbin/service glusterd reload',
$misc_gluster_repo = 'https://download.gluster.org/pub/gluster/glusterfs/',