This adds defined anchor points for external modules to hook into the software install, config and service dependency chain. This allows external modules to manage software installation (virtualenv, containers, etc) and service management (pacemaker) without needing rely on resources that may change or be renamed. Change-Id: I00cf4846bb933291469be94c9debed425eddf798
		
			
				
	
	
		
			29 lines
		
	
	
		
			784 B
		
	
	
	
		
			Puppet
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			784 B
		
	
	
	
		
			Puppet
		
	
	
	
	
	
# Swift::Ring::Rebalance
 | 
						|
#   Reblances the specified ring. Assumes that the ring already exists
 | 
						|
#   and is stored at /etc/swift/${name}.builder
 | 
						|
#
 | 
						|
# == Parameters
 | 
						|
#
 | 
						|
# [*name*] Type of ring to rebalance. The ring file is assumed to be at the path
 | 
						|
#   /etc/swift/${name}.builder
 | 
						|
#
 | 
						|
# [*seed*] Optional. Seed value used to seed pythons pseudo-random for ringbuilding.
 | 
						|
define swift::ringbuilder::rebalance(
 | 
						|
  $seed = undef
 | 
						|
) {
 | 
						|
 | 
						|
  include ::swift::deps
 | 
						|
 | 
						|
  validate_re($name, '^object|container|account$')
 | 
						|
  if $seed {
 | 
						|
    validate_re($seed, '^\d+$')
 | 
						|
  }
 | 
						|
 | 
						|
  exec { "rebalance_${name}":
 | 
						|
    command     => strip("swift-ring-builder /etc/swift/${name}.builder rebalance ${seed}"),
 | 
						|
    path        => ['/usr/bin'],
 | 
						|
    refreshonly => true,
 | 
						|
    before      => Anchor['swift::config::end'],
 | 
						|
  }
 | 
						|
}
 |