diff options
author | James Shubin <james@shubin.ca> | 2013-10-26 02:06:40 -0400 |
---|---|---|
committer | James Shubin <james@shubin.ca> | 2013-10-26 02:06:40 -0400 |
commit | fa5af57fcaf29691b1cd98506351753720005c93 (patch) | |
tree | 9327f0b67eb0e330a35d7af523a9bda9f279b99e | |
parent | e71fb3b68d7d7cebc7d0f9f03a38c3ae7f2a2a80 (diff) | |
download | puppet-gluster-fa5af57fcaf29691b1cd98506351753720005c93.tar.gz puppet-gluster-fa5af57fcaf29691b1cd98506351753720005c93.tar.xz puppet-gluster-fa5af57fcaf29691b1cd98506351753720005c93.zip |
Ensure user selected UUID's are valid.
-rw-r--r-- | manifests/host.pp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/manifests/host.pp b/manifests/host.pp index d30a9e4..1423d0f 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -28,6 +28,10 @@ define gluster::host( #$vardir = $::gluster::vardir::module_vardir # with trailing slash $vardir = regsubst($::gluster::vardir::module_vardir, '\/$', '') + if ("${uuid}" != '') and "${uuid}" =~ /^[a-f0-9]{8}\-[a-f0-9]{4}\-[a-f0-9]{4}\-[a-f0-9]{4}\-[a-f0-9]{12}$/) { + fail("The chosen UUID: '${uuid}' is not valid.") + } + Gluster::Host[$name] -> Service['glusterd'] # glusterd requires host # if we're on itself |