Emilien Macchi ff448f8733 swift/ringbuilder: allow to disable the ring building
When using Hiera, it's usefull to have the "enabled" parameter to either
enable or disable the ring building, since it should be run on one
single node.

Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
2014-06-11 13:54:30 +02:00

51 lines
1.4 KiB
Puppet

#
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# Swift ring builder node
#
class cloud::object::ringbuilder(
$enabled = false,
$rsyncd_ipaddress = '127.0.0.1',
$replicas = 3,
$swift_rsync_max_connections = 5,
) {
include cloud::object
if $enabled {
Ring_object_device <<| |>>
Ring_container_device <<| |>>
Ring_account_device <<| |>>
class {'swift::ringbuilder' :
part_power => 15,
replicas => $replicas,
min_part_hours => 24,
}
class {'swift::ringserver' :
local_net_ip => $rsyncd_ipaddress,
max_connections => $swift_rsync_max_connections,
}
# exports rsync gets that can be used to sync the ring files
@@swift::ringsync { ['account', 'object', 'container']:
ring_server => $rsyncd_ipaddress,
}
}
}