summaryrefslogtreecommitdiffstats
path: root/manifests
diff options
context:
space:
mode:
authorJames Shubin <james@shubin.ca>2014-03-07 16:44:58 -0500
committerJames Shubin <james@shubin.ca>2014-03-16 22:39:07 -0400
commit2804934ecba7dfd52a222765174ad1c3018bab5f (patch)
tree9db8b018a0e1d05815d1a5d99532db661adbb045 /manifests
parent905afa199635ec3cc8ba891c39bd66fe5d43c996 (diff)
downloadpuppet-gluster-2804934ecba7dfd52a222765174ad1c3018bab5f.tar.gz
puppet-gluster-2804934ecba7dfd52a222765174ad1c3018bab5f.tar.xz
puppet-gluster-2804934ecba7dfd52a222765174ad1c3018bab5f.zip
Add in a custom sponge utility to break the dependence on the EPEL repo.
Diffstat (limited to 'manifests')
-rw-r--r--manifests/server.pp14
-rw-r--r--manifests/volume.pp4
2 files changed, 15 insertions, 3 deletions
diff --git a/manifests/server.pp b/manifests/server.pp
index 6f4d5c9..e4e40e8 100644
--- a/manifests/server.pp
+++ b/manifests/server.pp
@@ -31,6 +31,11 @@ class gluster::server(
) {
$FW = '$FW' # make using $FW in shorewall easier
+ include gluster::vardir
+
+ #$vardir = $::gluster::vardir::module_vardir # with trailing slash
+ $vardir = regsubst($::gluster::vardir::module_vardir, '\/$', '')
+
# 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}" ? {
@@ -44,9 +49,16 @@ class gluster::server(
ensure_resource('gluster::repo', "${rname}", $params)
}
- package { 'moreutils': # for scripts needing: 'sponge'
+ # this is meant to be replace the excellent sponge utility by sponge.py
+ file { "${vardir}/sponge.py": # for scripts needing: 'sponge'
+ source => 'puppet:///modules/gluster/sponge.py',
+ owner => root,
+ group => nobody,
+ mode => 700, # u=rwx
+ backup => false, # don't backup to filebucket
ensure => present,
before => Package['glusterfs-server'],
+ require => File["${vardir}/"],
}
package { 'glusterfs-server':
diff --git a/manifests/volume.pp b/manifests/volume.pp
index 513a431..645c090 100644
--- a/manifests/volume.pp
+++ b/manifests/volume.pp
@@ -363,12 +363,12 @@ define gluster::volume(
$stack_truncate = "${maxlength}" ? {
'-1' => '', # unlimited
#default => sprintf("&& /bin/sed -i '%d,$ d' ${stackfile}", inline_template('<%= @maxlength.to_i.abs+1 %>')),
- default => sprintf(" && (/bin/grep -v '^$' ${stackfile} | /usr/bin/tail -n %d | /usr/bin/sponge ${stackfile})", inline_template('<%= @maxlength.to_i.abs %>')),
+ default => sprintf(" && (/bin/grep -v '^$' ${stackfile} | /usr/bin/tail -n %d | ${vardir}/sponge.py ${stackfile})", inline_template('<%= @maxlength.to_i.abs %>')),
}
$watch_truncate = "${maxlength}" ? {
'-1' => '', # unlimited
#default => sprintf("&& /bin/sed -i '%d,$ d' ${watchfile}", inline_template('<%= @maxlength.to_i.abs+1 %>')),
- default => sprintf(" && (/bin/grep -v '^$' ${watchfile} | /usr/bin/tail -n %d | /usr/bin/sponge ${watchfile})", inline_template('<%= @maxlength.to_i.abs %>')),
+ default => sprintf(" && (/bin/grep -v '^$' ${watchfile} | /usr/bin/tail -n %d | ${vardir}/sponge.py ${watchfile})", inline_template('<%= @maxlength.to_i.abs %>')),
}
if $are_bricks_collected and ("${valid_input}" != '') { # ready or not?