Removed swift::storage::device::* defines
Previously, I had created a define intended to wrap the creation of the storage device endpoints with their associated ring configs. I wound up decided against this for two reasons: - Abtstracting storage endpoints together with the ring configurations can be confusing b/c it conflates actions associated with the storage role with actions associated with the ringbuilding role. - Abstracting the ring building hides side effects of this manifest from the user (that it will effect the ringbuilder role) This pull request does the following: - removes the swift::storage::device::* defines - update the following code to use swift::storage::device in combination with ring_*_device -- examples/multi -- swift::storage::node
This commit is contained in:
@@ -121,36 +121,42 @@ class role_swift_proxy inherits role_swift {
|
|||||||
|
|
||||||
class role_swift_storage inherits role_swift {
|
class role_swift_storage inherits role_swift {
|
||||||
|
|
||||||
class { 'swift::storage': }
|
class { 'swift::storage':
|
||||||
|
storage_local_net_ip => $swift_local_net_ip,
|
||||||
|
}
|
||||||
|
|
||||||
# create xfs partitions on a loopback device and mount them
|
# create xfs partitions on a loopback device and mount them
|
||||||
swift::storage::loopback { '1':
|
swift::storage::loopback { '1':
|
||||||
|
base_dir => '/srv/loopback-device',
|
||||||
|
mnt_base_dir => '/srv/node',
|
||||||
require => Class['swift'],
|
require => Class['swift'],
|
||||||
}
|
}
|
||||||
|
|
||||||
swift::storage::device::object { '6001':
|
Swift::Storage::Device {
|
||||||
device_name => '1',
|
|
||||||
zone => $swift_zone,
|
|
||||||
weight => 1,
|
|
||||||
storage_local_net_ip => $swift_local_net_ip,
|
storage_local_net_ip => $swift_local_net_ip,
|
||||||
manage_ring => false,
|
devices => '/srv/node',
|
||||||
|
}
|
||||||
|
|
||||||
|
swift::storage::device { '8001': type => 'object',}
|
||||||
|
@@ring_object_device { "${swift_local_net_ip}:8001":
|
||||||
|
zone => 1,
|
||||||
|
device_name => 1,
|
||||||
|
weight => 1,
|
||||||
|
}
|
||||||
|
|
||||||
|
swift::storage::device { '8002': type => 'container',}
|
||||||
|
@@ring_container_device { "${swift_local_net_ip}:8002":
|
||||||
|
zone => 1,
|
||||||
|
device_name => 1,
|
||||||
|
weight => 1,
|
||||||
|
}
|
||||||
|
|
||||||
|
swift::storage::device { '8003': type => 'account',}
|
||||||
|
@@ring_account_device { "${swift_local_net_ip}:8003":
|
||||||
|
zone => 1,
|
||||||
|
device_name => 1,
|
||||||
|
weight => 1,
|
||||||
}
|
}
|
||||||
swift::storage::device::container { '6002':
|
|
||||||
device_name => '1',
|
|
||||||
zone => $swift_zone,
|
|
||||||
weight => 1,
|
|
||||||
storage_local_net_ip => $swift_local_net_ip,
|
|
||||||
manage_ring => false,
|
|
||||||
}
|
|
||||||
swift::storage::device::account { '6003':
|
|
||||||
device_name => '1',
|
|
||||||
zone => $swift_zone,
|
|
||||||
weight => 1,
|
|
||||||
storage_local_net_ip => $swift_local_net_ip,
|
|
||||||
manage_ring => false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class ring_hack {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,45 +0,0 @@
|
|||||||
#
|
|
||||||
# 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,
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@@ -1,44 +0,0 @@
|
|||||||
#
|
|
||||||
# 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,
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@@ -1,44 +0,0 @@
|
|||||||
#
|
|
||||||
# I am not sure if this is the right name
|
|
||||||
# - should it be device?
|
|
||||||
#
|
|
||||||
# name - is going to be port
|
|
||||||
define swift::storage::device::object(
|
|
||||||
$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 => 'object',
|
|
||||||
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_object_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_object_device { "${storage_local_net_ip}:${name}":
|
|
||||||
zone => $zone,
|
|
||||||
device_name => $device_name,
|
|
||||||
weight => $weight,
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@@ -15,40 +15,39 @@ define swift::storage::node(
|
|||||||
$manage_ring = true
|
$manage_ring = true
|
||||||
) {
|
) {
|
||||||
|
|
||||||
swift::storage::device::object { "60${name}0":
|
Swift::Storage::Device {
|
||||||
|
storage_local_net_ip => $storage_local_net_ip,
|
||||||
devices => $mnt_base_dir,
|
devices => $mnt_base_dir,
|
||||||
device_name => $name,
|
max_connections => $max_connections,
|
||||||
zone => $zone,
|
|
||||||
weight => $weight,
|
|
||||||
owner => $owner,
|
owner => $owner,
|
||||||
group => $group,
|
group => $group,
|
||||||
max_connections => $max_connections,
|
|
||||||
storage_local_net_ip => $storage_local_net_ip,
|
|
||||||
manage_ring => $manage_ring,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
swift::storage::device::container { "60${name}1":
|
swift::storage::device { "60${name}0":
|
||||||
devices => $mnt_base_dir,
|
type => 'object',
|
||||||
device_name => $name,
|
}
|
||||||
|
ring_object_device { "${storage_local_net_ip}:60${name}0":
|
||||||
zone => $zone,
|
zone => $zone,
|
||||||
|
device_name => $name,
|
||||||
weight => $weight,
|
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::account { "60${name}2":
|
swift::storage::device { "60${name}1":
|
||||||
devices => $mnt_base_dir,
|
type => 'container',
|
||||||
device_name => $name,
|
}
|
||||||
|
ring_container_device { "${storage_local_net_ip}:60${name}1":
|
||||||
zone => $zone,
|
zone => $zone,
|
||||||
|
device_name => $name,
|
||||||
|
weight => $weight,
|
||||||
|
}
|
||||||
|
|
||||||
|
swift::storage::device { "60${name}2":
|
||||||
|
type => 'account',
|
||||||
|
}
|
||||||
|
ring_account_device { "${storage_local_net_ip}:60${name}2":
|
||||||
|
zone => $zone,
|
||||||
|
device_name => $name,
|
||||||
weight => $weight,
|
weight => $weight,
|
||||||
owner => $owner,
|
|
||||||
group => $group,
|
|
||||||
max_connections => $max_connections,
|
|
||||||
storage_local_net_ip => $storage_local_net_ip,
|
|
||||||
manage_ring => $manage_ring,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user