![Alex Schultz](/assets/img/avatar_default.png)
This change allow the moving of swift components off of the controllers. This change adds four new heira values that can be used to install swift on nodes other than the controllers. The values are: *) swift_master_role - The role used to designate the primary swift node. Defaults to 'primary-controller'. *) swift_nodes - The list of swift nodes that will be configured. Defaults to using the controller(s) from heira *) primary_swift - A boolean used to indicate if this is the primary swift node. This is used to determine how to distrubute the ring files. By default, this uses the 'primary_controller' setting from hiera. *) swift_proxies - A list of swift nodes that swift proxy is running on. By default, the controllers are used. Partial blueprint: detach-components-from-controllers Change-Id: I8fe388f59892c05ff0fa55e06843fe0cd833c34c
19 lines
874 B
Puppet
19 lines
874 B
Puppet
notice('MODULAR: swift/rebalance_cronjob.pp')
|
|
|
|
$storage_hash = hiera('storage_hash')
|
|
$swift_master_role = hiera('swift_master_role', 'primary-controller')
|
|
$ring_min_part_hours = hiera('swift_ring_min_part_hours', 1)
|
|
|
|
# Use Swift if it isn't replaced by vCenter, Ceph for BOTH images and objects
|
|
if !($storage_hash['images_ceph'] and $storage_hash['objects_ceph']) and !$storage_hash['images_vcenter'] {
|
|
$master_swift_proxy_nodes = filter_nodes(hiera('nodes_hash'),'role',$swift_master_role)
|
|
$master_swift_proxy_ip = $master_swift_proxy_nodes[0]['storage_address']
|
|
|
|
# setup a cronjob to rebalance and repush rings periodically
|
|
class { 'openstack::swift::rebalance_cronjob':
|
|
ring_rebalance_period => min($ring_min_part_hours * 2, 23),
|
|
master_swift_proxy_ip => $master_swift_proxy_ip,
|
|
primary_proxy => hiera('primary_controller'),
|
|
}
|
|
}
|