add backup compression variable
adding backup_compression_algorithm to the swift.pp file to allow users to modify the setting via puppet Change-Id: Ieb10bb97a3aa7fa502b31e0898fc538e9dee1cf7
This commit is contained in:
parent
1d752f201b
commit
d6ccce6554
@ -29,6 +29,11 @@
|
||||
# (optional) The backoff time in seconds between Swift retries.
|
||||
# Defaults to '2'
|
||||
#
|
||||
# [*backup_compression_algorithm*]
|
||||
# (optional) The compression algorithm for the chunks sent to swift
|
||||
# Defaults to 'zlib'
|
||||
# set to None to disable compression
|
||||
#
|
||||
# === Author(s)
|
||||
#
|
||||
# Emilien Macchi <emilien.macchi@enovance.com>
|
||||
@ -51,21 +56,23 @@
|
||||
#
|
||||
#
|
||||
class cinder::backup::swift (
|
||||
$backup_driver = 'cinder.backup.drivers.swift',
|
||||
$backup_swift_url = 'http://localhost:8080/v1/AUTH_',
|
||||
$backup_swift_container = 'volumes_backup',
|
||||
$backup_swift_object_size = '52428800',
|
||||
$backup_swift_retry_attempts = '3',
|
||||
$backup_swift_retry_backoff = '2'
|
||||
$backup_driver = 'cinder.backup.drivers.swift',
|
||||
$backup_swift_url = 'http://localhost:8080/v1/AUTH_',
|
||||
$backup_swift_container = 'volumes_backup',
|
||||
$backup_swift_object_size = '52428800',
|
||||
$backup_swift_retry_attempts = '3',
|
||||
$backup_swift_retry_backoff = '2',
|
||||
$backup_compression_algorithm = 'zlib',
|
||||
) {
|
||||
|
||||
cinder_config {
|
||||
'DEFAULT/backup_driver': value => $backup_driver;
|
||||
'DEFAULT/backup_swift_url': value => $backup_swift_url;
|
||||
'DEFAULT/backup_swift_container': value => $backup_swift_container;
|
||||
'DEFAULT/backup_swift_object_size': value => $backup_swift_object_size;
|
||||
'DEFAULT/backup_swift_retry_attempts': value => $backup_swift_retry_attempts;
|
||||
'DEFAULT/backup_swift_retry_backoff': value => $backup_swift_retry_backoff;
|
||||
'DEFAULT/backup_driver': value => $backup_driver;
|
||||
'DEFAULT/backup_swift_url': value => $backup_swift_url;
|
||||
'DEFAULT/backup_swift_container': value => $backup_swift_container;
|
||||
'DEFAULT/backup_swift_object_size': value => $backup_swift_object_size;
|
||||
'DEFAULT/backup_swift_retry_attempts': value => $backup_swift_retry_attempts;
|
||||
'DEFAULT/backup_swift_retry_backoff': value => $backup_swift_retry_backoff;
|
||||
'DEFAULT/backup_compression_algorithm': value => $backup_compression_algorithm;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,11 +23,12 @@ require 'spec_helper'
|
||||
describe 'cinder::backup::swift' do
|
||||
|
||||
let :default_params do
|
||||
{ :backup_swift_url => 'http://localhost:8080/v1/AUTH_',
|
||||
:backup_swift_container => 'volumes_backup',
|
||||
:backup_swift_object_size => '52428800',
|
||||
:backup_swift_retry_attempts => '3',
|
||||
:backup_swift_retry_backoff => '2' }
|
||||
{ :backup_swift_url => 'http://localhost:8080/v1/AUTH_',
|
||||
:backup_swift_container => 'volumes_backup',
|
||||
:backup_swift_object_size => '52428800',
|
||||
:backup_swift_retry_attempts => '3',
|
||||
:backup_swift_retry_backoff => '2',
|
||||
:backup_compression_algorithm => 'zlib' }
|
||||
end
|
||||
|
||||
let :params do
|
||||
@ -46,6 +47,7 @@ describe 'cinder::backup::swift' do
|
||||
is_expected.to contain_cinder_config('DEFAULT/backup_swift_object_size').with_value(p[:backup_swift_object_size])
|
||||
is_expected.to contain_cinder_config('DEFAULT/backup_swift_retry_attempts').with_value(p[:backup_swift_retry_attempts])
|
||||
is_expected.to contain_cinder_config('DEFAULT/backup_swift_retry_backoff').with_value(p[:backup_swift_retry_backoff])
|
||||
is_expected.to contain_cinder_config('DEFAULT/backup_compression_algorithm').with_value(p[:backup_compression_algorithm])
|
||||
end
|
||||
|
||||
context 'when overriding default parameters' do
|
||||
@ -55,6 +57,7 @@ describe 'cinder::backup::swift' do
|
||||
params.merge!(:backup_swift_object_size => '123')
|
||||
params.merge!(:backup_swift_retry_attempts => '99')
|
||||
params.merge!(:backup_swift_retry_backoff => '56')
|
||||
params.merge!(:backup_compression_algorithm => 'None')
|
||||
end
|
||||
it 'should replace default parameters with new values' do
|
||||
is_expected.to contain_cinder_config('DEFAULT/backup_swift_url').with_value(p[:backup_swift_url])
|
||||
@ -62,6 +65,7 @@ describe 'cinder::backup::swift' do
|
||||
is_expected.to contain_cinder_config('DEFAULT/backup_swift_object_size').with_value(p[:backup_swift_object_size])
|
||||
is_expected.to contain_cinder_config('DEFAULT/backup_swift_retry_attempts').with_value(p[:backup_swift_retry_attempts])
|
||||
is_expected.to contain_cinder_config('DEFAULT/backup_swift_retry_backoff').with_value(p[:backup_swift_retry_backoff])
|
||||
is_expected.to contain_cinder_config('DEFAULT/backup_compression_algorithm').with_value(p[:backup_compression_algorithm])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user