Files
puppet-swift/manifests/storage/device/account.pp
Dan Bode a6fcff35ef Add defines for managing devices and rings
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.
2012-01-27 21:59:50 -08:00

46 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::account(
$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 => 'account',
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_account_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_account_device { "${storage_local_net_ip}:${name}":
zone => $zone,
device_name => $device_name,
weight => $weight,
}
}
}