From 3e8c4bf7305b956bfb3d77048ef8058f41581824 Mon Sep 17 00:00:00 2001 From: James Shubin Date: Sat, 26 Oct 2013 02:07:15 -0400 Subject: 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. --- manifests/host.pp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'manifests') 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}", -- cgit