Implements three defines that can be used to manage the three kinds of swift devices: - objects - accounts - containers These defines wrap swift::storage::device (which manages rsync modules and swift device configuration) and add additional resources for managing the ring device entries. The defines accept a parameter called manage_ring which can be used to specify rather the ringbuilding resources should be declared or exported.
		
			
				
	
	
		
			45 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Puppet
		
	
	
	
	
	
			
		
		
	
	
			45 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Puppet
		
	
	
	
	
	
#
 | 
						|
# I am not sure if this is the right name
 | 
						|
#   - should it be device?
 | 
						|
#
 | 
						|
#  name - is going to be port
 | 
						|
define swift::storage::device::container(
 | 
						|
  $device_name,
 | 
						|
  $zone,
 | 
						|
  $weight = 1,
 | 
						|
  $storage_local_net_ip = '127.0.0.1',
 | 
						|
  $devices = '/srv/node',
 | 
						|
  $owner = 'swift',
 | 
						|
  $group  = 'swift',
 | 
						|
  $max_connections = 25,
 | 
						|
  $manage_ring = true
 | 
						|
) {
 | 
						|
 | 
						|
  swift::storage::device { $name:
 | 
						|
    type                 => 'container',
 | 
						|
    storage_local_net_ip => $storage_local_net_ip,
 | 
						|
    devices              => $devices,
 | 
						|
    owner                => $owner,
 | 
						|
    group                => $group,
 | 
						|
    max_connections      => $max_connections,
 | 
						|
  }
 | 
						|
 | 
						|
  # if we are managing the ring on this node
 | 
						|
  if($manage_ring) {
 | 
						|
    ring_container_device { "${storage_local_net_ip}:${name}":
 | 
						|
      zone        => $zone,
 | 
						|
      device_name => $device_name,
 | 
						|
      weight      => $weight,
 | 
						|
    }
 | 
						|
  } else {
 | 
						|
    # if we are not managing the ring on this node, just export the resource
 | 
						|
    @@ring_container_device { "${storage_local_net_ip}:${name}":
 | 
						|
      zone        => $zone,
 | 
						|
      device_name => $device_name,
 | 
						|
      weight      => $weight,
 | 
						|
    }
 | 
						|
 | 
						|
  }
 | 
						|
 | 
						|
}
 |