forked from redhat-openstack/openstack-puppet-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update cinder to d6ccce6554e85ee50d926bbc413c1a1ea2ddffbf
d6ccce6554e85ee50d926bbc413c1a1ea2ddffbf add backup compression variable 1d752f201b4d01f665d8b4016ff32a9742892578 Merge "Clean Gemfile: drop rspec-puppet and rake" 09887d1c6448db1cc0184524ad92f091689009ba Merge "Beaker tests" 4d8736b1f72b29747775e7857fd882fe831db570 Clean Gemfile: drop rspec-puppet and rake e09f3c41ab45fe01c6b9bd56a27745cfff1fde77 Beaker tests 8edb8b6e07ac7ce64a70396f54910eda7e93406c Add support for NFS Backup 4a3bfbce84de3d20a5e8c7ec3d5bcdcd3f248bc3 Fix spec tests for RSpec 3.x and Puppet 4.x 9bb2361d4bc91418392157c08ca5282b5d9bc47d Bump rspec-puppet to 2.1.0 d85984552fd321cdac16bfd607ce955779b23bd5 Merge "Add nfs_mount_options variable when backend is NetApp" 3fec66b4614118c9b2a3fc48090ca18f1d6ffc80 Merge "MySQL: change default MySQL collate to utf8_general_ci" 08be3c0df1bce50cdc2f2f85cf0d9ea1016faca9 MySQL: change default MySQL collate to utf8_general_ci fae6f15f8623e3a857bd60ea0ce8290d32e280eb Add nfs_mount_options variable when backend is NetApp
- Loading branch information
Showing
19 changed files
with
447 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
# == Class: cinder::backup::nfs | ||
# | ||
# Setup Cinder to backup volumes into NFS | ||
# | ||
# === Parameters | ||
# | ||
# [*backup_share*] | ||
# (required) The NFS share to attach to, to be specified in | ||
# fqdn:path, ipv4addr:path, or "[ipv6addr]:path" format. | ||
# | ||
# [*backup_driver*] | ||
# (optional) The backup driver for NFS back-end. | ||
# Defaults to 'cinder.backup.drivers.nfs'. | ||
# | ||
# [*backup_file_size*] | ||
# (optional) The maximum size in bytes of the files used to hold | ||
# backups. If the volume being backed up exceeds this size, then | ||
# it will be backed up into multiple files. This must be a multiple | ||
# of the backup_sha_block_size_bytes parameter. | ||
# Defaults to 1999994880 | ||
# | ||
# [*backup_sha_block_size_bytes*] | ||
# (optional) The size in bytes that changes are tracked for | ||
# incremental backups. | ||
# Defaults to 32768 | ||
# | ||
# [*backup_enable_progress_timer*] | ||
# (optional) Enable or Disable the timer to send the periodic | ||
# progress notifications to Ceilometer when backing up the volume | ||
# to the backend storage. | ||
# Defaults to true | ||
# | ||
# [*backup_mount_point_base*] | ||
# (optional) The base directory containing the mount point for the | ||
# NFS share. | ||
# Defaults to '$state_path/backup_mount' | ||
# | ||
# [*backup_mount_options*] | ||
# (optional) The mount options that are passed to the NFS client. | ||
# Defaults to undef | ||
# | ||
# [*backup_container*] | ||
# (optional) Custom container to use for backups. | ||
# Defaults to undef | ||
# | ||
# [*backup_compression_algorithm*] | ||
# (optional) Compression algorithm to use when writing backup data. | ||
# Defaults to 'zlib' | ||
# | ||
# === Author(s) | ||
# | ||
# Ryan Hefner <[email protected]> | ||
# | ||
# === Copyright | ||
# | ||
# Copyright (C) 2015 Ryan Hefner <[email protected]> | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
# | ||
class cinder::backup::nfs ( | ||
$backup_share, | ||
$backup_driver = 'cinder.backup.drivers.nfs', | ||
$backup_file_size = 1999994880, | ||
$backup_sha_block_size_bytes = 32768, | ||
$backup_enable_progress_timer = true, | ||
$backup_mount_point_base = '$state_path/backup_mount', | ||
$backup_mount_options = undef, | ||
$backup_container = undef, | ||
$backup_compression_algorithm = 'zlib', | ||
) { | ||
|
||
validate_string($backup_share) | ||
|
||
if $backup_mount_options { | ||
cinder_config { | ||
'DEFAULT/backup_mount_options': value => $backup_mount_options; | ||
} | ||
} else { | ||
cinder_config { | ||
'DEFAULT/backup_mount_options': ensure => absent; | ||
} | ||
} | ||
|
||
cinder_config { | ||
'DEFAULT/backup_share': value => $backup_share; | ||
'DEFAULT/backup_driver': value => $backup_driver; | ||
'DEFAULT/backup_file_size': value => $backup_file_size; | ||
'DEFAULT/backup_sha_block_size_bytes': value => $backup_sha_block_size_bytes; | ||
'DEFAULT/backup_enable_progress_timer': value => $backup_enable_progress_timer; | ||
'DEFAULT/backup_mount_point_base': value => $backup_mount_point_base; | ||
'DEFAULT/backup_container': value => $backup_container; | ||
'DEFAULT/backup_compression_algorithm': value => $backup_compression_algorithm; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <[email protected]> | ||
|
@@ -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; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'basic cinder' do | ||
|
||
context 'default parameters' do | ||
|
||
it 'should work with no errors' do | ||
pp= <<-EOS | ||
Exec { logoutput => 'on_failure' } | ||
# Common resources | ||
include ::apt | ||
# some packages are not autoupgraded in trusty. | ||
# it will be fixed in liberty, but broken in kilo. | ||
$need_to_be_upgraded = ['python-tz', 'python-pbr'] | ||
apt::source { 'trusty-updates-kilo': | ||
location => 'http://ubuntu-cloud.archive.canonical.com/ubuntu/', | ||
release => 'trusty-updates', | ||
required_packages => 'ubuntu-cloud-keyring', | ||
repos => 'kilo/main', | ||
trusted_source => true, | ||
} ~> | ||
exec { '/usr/bin/apt-get -y dist-upgrade': | ||
refreshonly => true, | ||
} | ||
Apt::Source['trusty-updates-kilo'] -> Package<| |> | ||
class { '::mysql::server': } | ||
class { '::rabbitmq': | ||
delete_guest_user => true, | ||
erlang_cookie => 'secrete', | ||
} | ||
rabbitmq_vhost { '/': | ||
provider => 'rabbitmqctl', | ||
require => Class['rabbitmq'], | ||
} | ||
rabbitmq_user { 'cinder': | ||
admin => true, | ||
password => 'an_even_bigger_secret', | ||
provider => 'rabbitmqctl', | ||
require => Class['rabbitmq'], | ||
} | ||
rabbitmq_user_permissions { 'cinder@/': | ||
configure_permission => '.*', | ||
write_permission => '.*', | ||
read_permission => '.*', | ||
provider => 'rabbitmqctl', | ||
require => Class['rabbitmq'], | ||
} | ||
# Keystone resources, needed by Cinder to run | ||
class { '::keystone::db::mysql': | ||
password => 'keystone', | ||
} | ||
class { '::keystone': | ||
verbose => true, | ||
debug => true, | ||
database_connection => 'mysql://keystone:[email protected]/keystone', | ||
admin_token => 'admin_token', | ||
enabled => true, | ||
} | ||
class { '::keystone::roles::admin': | ||
email => '[email protected]', | ||
password => 'a_big_secret', | ||
} | ||
class { '::keystone::endpoint': | ||
public_url => "https://${::fqdn}:5000/", | ||
admin_url => "https://${::fqdn}:35357/", | ||
} | ||
# Cinder resources | ||
class { '::cinder': | ||
database_connection => 'mysql://cinder:[email protected]/cinder?charset=utf8', | ||
rabbit_userid => 'cinder', | ||
rabbit_password => 'an_even_bigger_secret', | ||
rabbit_host => '127.0.0.1', | ||
} | ||
class { '::cinder::keystone::auth': | ||
password => 'a_big_secret', | ||
} | ||
class { '::cinder::db::mysql': | ||
password => 'a_big_secret', | ||
} | ||
class { '::cinder::api': | ||
keystone_password => 'a_big_secret', | ||
identity_uri => 'http://127.0.0.1:35357/', | ||
default_volume_type => 'iscsi_backend', | ||
} | ||
class { '::cinder::backup': } | ||
class { '::cinder::ceilometer': } | ||
class { '::cinder::client': } | ||
class { '::cinder::quota': } | ||
class { '::cinder::scheduler': } | ||
class { '::cinder::volume': } | ||
# TODO: create a backend and spawn a volume | ||
EOS | ||
|
||
|
||
# Run it twice to test for idempotency | ||
apply_manifest(pp, :catch_failures => true) | ||
apply_manifest(pp, :catch_changes => true) | ||
end | ||
|
||
describe port(8776) do | ||
it { is_expected.to be_listening.with('tcp') } | ||
end | ||
|
||
end | ||
end |
Oops, something went wrong.