Refactor swift::storage::node to use device defines

This commit updates the node class from using
Swift::Storage::Device to the individual defines.

This change was made b/c we could not dyncamically
set the names of the native types.
This commit is contained in:
Dan Bode
2012-01-27 22:09:31 -08:00
parent 67d53de23a
commit b035a32b42

View File

@@ -1,28 +1,54 @@
#
# Builds out a default storage node
# a storage node is a device that contains
# a storage endpoint for account, container, and object
# on the same mount point
#
define swift::storage::node( define swift::storage::node(
$mnt_base_dir, $mnt_base_dir,
$zone,
$weight = 1,
$owner = 'swift', $owner = 'swift',
$group = 'swift', $group = 'swift',
$max_connections = 25, $max_connections = 25,
$storage_local_net_ip = '127.0.0.1' $storage_local_net_ip = '127.0.0.1',
$manage_ring = true
) { ) {
Swift::Storage::Device { swift::storage::device::object { "60${name}0":
devices => $mnt_base_dir, devices => $mnt_base_dir,
owner => $owner, device_name => $name,
group => $group, zone => $zone,
max_connections => $max_connections, weight => $weight,
owner => $owner,
group => $group,
max_connections => $max_connections,
storage_local_net_ip => $storage_local_net_ip,
manage_ring => $manage_ring,
} }
swift::storage::device { "60${name}0": swift::storage::device::container { "60${name}1":
type => 'object', devices => $mnt_base_dir,
device_name => $name,
zone => $zone,
weight => $weight,
owner => $owner,
group => $group,
max_connections => $max_connections,
storage_local_net_ip => $storage_local_net_ip,
manage_ring => $manage_ring,
} }
swift::storage::device { "60${name}1": swift::storage::device::account { "60${name}2":
type => 'container', devices => $mnt_base_dir,
} device_name => $name,
zone => $zone,
swift::storage::device { "60${name}2": weight => $weight,
type => 'account', owner => $owner,
group => $group,
max_connections => $max_connections,
storage_local_net_ip => $storage_local_net_ip,
manage_ring => $manage_ring,
} }
} }