summaryrefslogtreecommitdiffstats
path: root/manifests/brick.pp
diff options
context:
space:
mode:
authorJames Shubin <james@shubin.ca>2013-01-10 21:40:01 -0500
committerJames Shubin <james@shubin.ca>2013-01-10 21:40:01 -0500
commit9aae259df87ab22b47185d9ff61d1d0020f33d2a (patch)
tree3766a3a0d1c2f6569113e17dd515009abac31c4d /manifests/brick.pp
parentaf3dc907993a6a5cd2b65eede523b2d1b0fae00d (diff)
downloadpuppet-gluster-9aae259df87ab22b47185d9ff61d1d0020f33d2a.tar.gz
puppet-gluster-9aae259df87ab22b47185d9ff61d1d0020f33d2a.tar.xz
puppet-gluster-9aae259df87ab22b47185d9ff61d1d0020f33d2a.zip
Improved split logic.
Diffstat (limited to 'manifests/brick.pp')
-rw-r--r--manifests/brick.pp6
1 files changed, 5 insertions, 1 deletions
diff --git a/manifests/brick.pp b/manifests/brick.pp
index 1a28892..175d590 100644
--- a/manifests/brick.pp
+++ b/manifests/brick.pp
@@ -29,7 +29,11 @@ define gluster::brick(
# eg: annex1.example.com:/storage1a
$split = split($name, ':') # do some $name parsing
$host = $split[0] # host fqdn
- $mount = $split[1] # brick mount
+ # NOTE: technically $mount should be everything BUT split[0]. This
+ # lets our $mount include colons if for some reason they're needed.
+ #$mount = $split[1] # brick mount
+ # TODO: create substring function
+ $mount = inline_template("<%= '${name}'.slice('${host}'.length+1, '${name}'.length-'${host}'.length-1) %>")
if ! ( "${host}:${mount}" == "${name}" ) {
fail('The brick $name must match a $host-$mount pattern.')