diff options
author | James Shubin <james@shubin.ca> | 2013-10-10 17:37:45 -0400 |
---|---|---|
committer | James Shubin <james@shubin.ca> | 2013-10-10 17:37:45 -0400 |
commit | 24ef469df05f552c5c7d4b5bd46fff740557b4e2 (patch) | |
tree | 371b779ebb35e3a4b3df5be153e0b764539d4181 /manifests | |
parent | 392308ceaf80b83bb87210e013e4fd07c40beba9 (diff) | |
download | puppet-gluster-24ef469df05f552c5c7d4b5bd46fff740557b4e2.tar.gz puppet-gluster-24ef469df05f552c5c7d4b5bd46fff740557b4e2.tar.xz puppet-gluster-24ef469df05f552c5c7d4b5bd46fff740557b4e2.zip |
Small VIP fixes.
This lets us specify the VIP in ::server, and inherit it in all volumes.
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/server.pp | 2 | ||||
-rw-r--r-- | manifests/volume.pp | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/manifests/server.pp b/manifests/server.pp index a14419a..a575a06 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -16,7 +16,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. class gluster::server( - #$vip = '', # vip of the cluster (optional but recommended) + $vip = '', # vip of the cluster (optional but recommended) $nfs = false, # TODO $shorewall = false, $zone = 'net', # TODO: allow a list of zones diff --git a/manifests/volume.pp b/manifests/volume.pp index 88d7b0d..96e6bc0 100644 --- a/manifests/volume.pp +++ b/manifests/volume.pp @@ -51,8 +51,13 @@ define gluster::volume( default => "stripe ${stripe} ", } + $valid_vip = "${vip}" ? { + '' => $::gluster::server::vip, + default => "${vip}", + } + # returns interface name that has vip, or '' if none are found. - $vipif = inline_template("<%= interfaces.split(',').find_all {|x| '${vip}' == scope.lookupvar('ipaddress_'+x) }[0,1].join('') %>") + $vipif = inline_template("<%= interfaces.split(',').find_all {|x| '${valid_vip}' == scope.lookupvar('ipaddress_'+x) }[0,1].join('') %>") #Gluster::Brick[$bricks] -> Gluster::Volume[$name] # volume requires bricks @@ -113,7 +118,7 @@ define gluster::volume( } # run if vip not defined (bypass mode) or if vip exists on this machine - if ($vip == '' or $vipif != '') { + if ("${valid_vip}" == '' or "${vipif}" != '') { # store command in a separate file to run as bash... # NOTE: we sleep for 5 seconds to give glusterd a chance to @@ -152,7 +157,7 @@ define gluster::volume( } # run if vip not defined (by pass mode) or vip exists on this machine - if ($vip == '' or $vipif != '') { + if ("${valid_vip}" == '' or "${vipif}" != '') { if $start == true { # try to start volume if stopped exec { "/usr/sbin/gluster volume start ${name}": |