44b1c56d74
Changed the name of the defined resource type: swift::storage::device to be swift::storage::server. This change was made in order to better align with the swift terminology since this define was configuring a swift component server which has no direct association with a device. This commit also makes the swift::storage::server the only place where the swift server template is used. This allowed me to assume that the variables device and bind_port will always be available. Also updates declarations of the renamed type to use the correct type name. Removes the direct server file config from swift::storage, replacing it instead with declarations of swift::storage::server.
44 lines
1.0 KiB
Puppet
44 lines
1.0 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::server(
|
|
$type,
|
|
$devices = '/srv/node',
|
|
$owner = 'swift',
|
|
$group = 'swift',
|
|
$max_connections = 25,
|
|
$storage_local_net_ip = '127.0.0.1',
|
|
# this parameters needs to be specified after type and name
|
|
$config_file_path = "${type}-server/${name}.conf"
|
|
) {
|
|
|
|
validate_re($name, '^\d+$')
|
|
validate_re($type, '^object|container|account$')
|
|
# TODO - validate that name is an integer
|
|
|
|
# This makes me think that perhaps the rsync class
|
|
# should be split into install and config
|
|
#
|
|
Swift::Storage::Server[$name] ~> Service['rsync']
|
|
|
|
$bind_port = $name
|
|
|
|
rsync::server::module { "${type}${name}":
|
|
path => $devices,
|
|
lock_file => "/var/lock/${type}${name}.lock",
|
|
uid => $owner,
|
|
gid => $group,
|
|
max_connections => $max_connections,
|
|
read_only => false,
|
|
}
|
|
|
|
file { "/etc/swift/${config_file_path}":
|
|
content => template("swift/${type}-server.conf.erb"),
|
|
owner => $owner,
|
|
group => $group,
|
|
}
|
|
|
|
}
|