Merge "Update openstack::swift to support disk storage_type"

This commit is contained in:
Jenkins
2013-06-23 07:25:40 +00:00
committed by Gerrit Code Review
2 changed files with 61 additions and 2 deletions

View File

@@ -7,10 +7,11 @@ class openstack::swift::storage-node (
$storage_mnt_base_dir = '/srv/node',
$storage_devices = ['1', '2'],
$storage_weight = 1,
$package_ensure = 'present'
$package_ensure = 'present',
$byte_size = '1024',
) {
class { 'swift':
class { 'swift':
swift_hash_suffix => $swift_hash_suffix,
package_ensure => $package_ensure,
}
@@ -24,6 +25,13 @@ class openstack::swift::storage-node (
require => Class['swift'],
}
}
# make xfs filesystem on physical disk and mount them
'disk': {
swift::storage::disk {$storage_devices:
mnt_base_dir => $storage_mnt_base_dir,
byte_size => $byte_size,
}
}
}
# install all swift storage servers together

View File

@@ -0,0 +1,51 @@
require 'spec_helper'
describe 'openstack::swift::storage-node' do
let :params do
{
:swift_zone => '1',
:storage_devices => '1',
}
end
let :facts do
{ :ipaddress_eth0 => '192.168.1.2' }
end
it 'should configure using the default values' do
should contain_class('swift').with(
:swift_hash_suffix => 'swift_secret',
:package_ensure => 'present',
)
should contain_define('swift::storage::loopback').with(
:base_dir => '/srv/loopback-device',
:mnt_base_dir => '/srv/node',
)
should contain_class('swift::storage::all').with(
:storage_local_net_ip => '192.168.1.2',
)
end
describe 'when setting up dsik for storage_type' do
before do
params.merge!(
:storage_type => 'disk',
:storage_devices => 'sda',
)
end
it 'should configure using the configured values' do
should contain_class('swift').with(
:swift_hash_suffix => 'swift_secret',
:package_ensure => 'present',
)
should contain_define('swift::storage::disk').with(
:mnt_base_dir => '/srv/node',
:byte_size => '1024',
)
should contain_class('swift::storage::all').with(
:storage_local_net_ip => '192.168.1.2',
)
end
end