summaryrefslogtreecommitdiffstats
path: root/manifests
diff options
context:
space:
mode:
authorJames Shubin <james@shubin.ca>2013-10-26 02:07:15 -0400
committerJames Shubin <james@shubin.ca>2013-10-26 02:07:15 -0400
commit3e8c4bf7305b956bfb3d77048ef8058f41581824 (patch)
treeae48f231c2f2785549ec04bdabccff42fea068ea /manifests
parentfa5af57fcaf29691b1cd98506351753720005c93 (diff)
downloadpuppet-gluster-3e8c4bf7305b956bfb3d77048ef8058f41581824.tar.gz
puppet-gluster-3e8c4bf7305b956bfb3d77048ef8058f41581824.tar.xz
puppet-gluster-3e8c4bf7305b956bfb3d77048ef8058f41581824.zip
Set the generated UUID to have the value of the user generated one.
If a user decides to manually set a host UUID, then save that UUID so that subsequent removal of manual UUID settings won't cause the UUID to change. This is useful if you want to start using automatic UUID's when you weren't previously.
Diffstat (limited to 'manifests')
-rw-r--r--manifests/host.pp15
1 files changed, 15 insertions, 0 deletions
diff --git a/manifests/host.pp b/manifests/host.pp
index 1423d0f..461eb62 100644
--- a/manifests/host.pp
+++ b/manifests/host.pp
@@ -53,6 +53,21 @@ define gluster::host(
require => File["${vardir}/"],
}
+ # if we manually *pick* a uuid, then store it too, so that it
+ # sticks if we ever go back to using automatic uuids. this is
+ # useful if a user wants to initially import uuids by picking
+ # them manually, and then letting puppet take over afterwards
+ if "${uuid}" != '' {
+ file { "${vardir}/uuid/uuid":
+ content => "${uuid}\n",
+ owner => root,
+ group => root,
+ mode => 600, # might as well...
+ ensure => present,
+ require => File["${vardir}/uuid/"],
+ }
+ }
+
$valid_uuid = "${uuid}" ? {
# fact from the data generated in: ${vardir}/uuid/uuid
'' => "${::gluster_uuid}",