Merge "Update openstack::swift to support disk storage_type"
This commit is contained in:
@@ -7,7 +7,8 @@ class openstack::swift::storage-node (
|
|||||||
$storage_mnt_base_dir = '/srv/node',
|
$storage_mnt_base_dir = '/srv/node',
|
||||||
$storage_devices = ['1', '2'],
|
$storage_devices = ['1', '2'],
|
||||||
$storage_weight = 1,
|
$storage_weight = 1,
|
||||||
$package_ensure = 'present'
|
$package_ensure = 'present',
|
||||||
|
$byte_size = '1024',
|
||||||
) {
|
) {
|
||||||
|
|
||||||
class { 'swift':
|
class { 'swift':
|
||||||
@@ -24,6 +25,13 @@ class openstack::swift::storage-node (
|
|||||||
require => Class['swift'],
|
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
|
# install all swift storage servers together
|
||||||
|
51
spec/classes/openstack_swift_storage-node.rb
Normal file
51
spec/classes/openstack_swift_storage-node.rb
Normal 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
|
Reference in New Issue
Block a user