puppet-swift/manifests/storage/node.pp
William Van Hevelingen 64ff379fad Validate that swift zones are integers.
As per the docs, zones are numbers starting at 1.
http://docs.openstack.org/developer/swift/deployment_guide.html#preparing-the-ring

Change-Id: I9bcc1616ad266b09ae4be65bf35b31ea0a455af7
2013-08-13 16:19:04 -07:00

56 lines
1.4 KiB
Puppet

#
# 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(
$mnt_base_dir,
$zone,
$weight = 1,
$owner = 'swift',
$group = 'swift',
$max_connections = 25,
$storage_local_net_ip = '127.0.0.1',
$manage_ring = true
) {
validate_re($zone, '^\d+$', 'The zone parameter must be an integer')
Swift::Storage::Server {
storage_local_net_ip => $storage_local_net_ip,
devices => $mnt_base_dir,
max_connections => $max_connections,
owner => $owner,
group => $group,
}
swift::storage::server { "60${name}0":
type => 'object',
config_file_path => 'object-server.conf',
}
ring_object_device { "${storage_local_net_ip}:60${name}0/${name}":
zone => $zone,
weight => $weight,
}
swift::storage::server { "60${name}1":
type => 'container',
config_file_path => 'container-server.conf',
}
ring_container_device { "${storage_local_net_ip}:60${name}1/${name}":
zone => $zone,
weight => $weight,
}
swift::storage::server { "60${name}2":
type => 'account',
config_file_path => 'account-server.conf',
}
ring_account_device { "${storage_local_net_ip}:60${name}2/${name}":
zone => $zone,
weight => $weight,
}
}