diff --git a/Puppetfile b/Puppetfile index 43f17db5f..65438bf7f 100644 --- a/Puppetfile +++ b/Puppetfile @@ -15,7 +15,7 @@ mod 'certmonger', :git => 'https://github.com/rcritten/puppet-certmonger.git' mod 'cinder', - :commit => '8cc6d0e60ee6d9d0c1ebcf3523b07c3024c47064', + :commit => '59f9e2c07f2a2fe981322e77b12d4862fe599a57', :git => 'https://github.com/stackforge/puppet-cinder.git' mod 'common', diff --git a/cinder/Gemfile b/cinder/Gemfile index df423e23b..4349e6e75 100644 --- a/cinder/Gemfile +++ b/cinder/Gemfile @@ -2,9 +2,19 @@ source 'https://rubygems.org' group :development, :test do gem 'puppetlabs_spec_helper', :require => false + gem 'puppet-lint', '~> 1.1' - gem 'rspec-puppet', '~> 1.0.1' gem 'puppet-lint-param-docs', '1.1.0' + gem 'puppet-lint-absolute_classname-check' + gem 'puppet-lint-absolute_template_path' + gem 'puppet-lint-trailing_newline-check' + # Puppet 4.x related lint checks + gem 'puppet-lint-unquoted_string-check' + gem 'puppet-lint-leading_zero-check' + gem 'puppet-lint-variable_contains_upcase' + gem 'puppet-lint-numericvariable' + + gem 'rspec-puppet', '~> 1.0.1' gem 'rake', '10.1.1' gem 'rspec', '< 2.99' gem 'json' diff --git a/cinder/examples/cinder_volume_with_pacemaker.pp b/cinder/examples/cinder_volume_with_pacemaker.pp index 4a38db7f7..fa590d06b 100644 --- a/cinder/examples/cinder_volume_with_pacemaker.pp +++ b/cinder/examples/cinder_volume_with_pacemaker.pp @@ -21,18 +21,18 @@ # # sudo pcs constraint colocation add cinder_api_service with cinder_vip -class { 'cinder': +class { '::cinder': database_connection => 'mysql://cinder:secret_block_password@openstack-controller.example.com/cinder', } -class { 'cinder::api': +class { '::cinder::api': keystone_password => 'CINDER_PW', keystone_user => 'cinder', enabled => false, manage_service => false, } -class { 'cinder::scheduler': +class { '::cinder::scheduler': scheduler_driver => 'cinder.scheduler.simple.SimpleScheduler', enabled => false, manage_service => false, diff --git a/cinder/manifests/api.pp b/cinder/manifests/api.pp index f7f1e414c..aaf350e27 100644 --- a/cinder/manifests/api.pp +++ b/cinder/manifests/api.pp @@ -132,8 +132,8 @@ $validation_options = {}, ) { - include cinder::params - include cinder::policy + include ::cinder::params + include ::cinder::policy Cinder_config<||> ~> Service['cinder-api'] Cinder_api_paste_ini<||> ~> Service['cinder-api'] diff --git a/cinder/manifests/backend/emc_vnx.pp b/cinder/manifests/backend/emc_vnx.pp index 5b060d39f..c5045a390 100644 --- a/cinder/manifests/backend/emc_vnx.pp +++ b/cinder/manifests/backend/emc_vnx.pp @@ -47,7 +47,7 @@ $volume_backend_name = $name, ) { - include cinder::params + include ::cinder::params cinder_config { "${name}/default_timeout": value => $default_timeout; diff --git a/cinder/manifests/backend/iscsi.pp b/cinder/manifests/backend/iscsi.pp index 2d03fa5f3..4e0e12574 100644 --- a/cinder/manifests/backend/iscsi.pp +++ b/cinder/manifests/backend/iscsi.pp @@ -15,7 +15,7 @@ $iscsi_helper = $::cinder::params::iscsi_helper, ) { - include cinder::params + include ::cinder::params cinder_config { "${name}/volume_backend_name": value => $volume_backend_name; diff --git a/cinder/manifests/backend/rbd.pp b/cinder/manifests/backend/rbd.pp index f0d5a0841..80cebc4c0 100644 --- a/cinder/manifests/backend/rbd.pp +++ b/cinder/manifests/backend/rbd.pp @@ -49,7 +49,7 @@ $rbd_max_clone_depth = '5', ) { - include cinder::params + include ::cinder::params cinder_config { "${name}/volume_backend_name": value => $volume_backend_name; diff --git a/cinder/manifests/backup.pp b/cinder/manifests/backup.pp index 07e91b75a..cc427d5e8 100644 --- a/cinder/manifests/backup.pp +++ b/cinder/manifests/backup.pp @@ -58,7 +58,7 @@ $backup_name_template = 'backup-%s' ) { - include cinder::params + include ::cinder::params Cinder_config<||> ~> Service['cinder-backup'] Exec<| title == 'cinder-manage db_sync' |> ~> Service['cinder-backup'] diff --git a/cinder/manifests/client.pp b/cinder/manifests/client.pp index eec3c0c74..f889dd519 100644 --- a/cinder/manifests/client.pp +++ b/cinder/manifests/client.pp @@ -12,7 +12,7 @@ $package_ensure = 'present' ) { - include cinder::params + include ::cinder::params package { 'python-cinderclient': ensure => $package_ensure, diff --git a/cinder/manifests/db/sync.pp b/cinder/manifests/db/sync.pp index 942f25213..528111a2f 100644 --- a/cinder/manifests/db/sync.pp +++ b/cinder/manifests/db/sync.pp @@ -1,7 +1,7 @@ # class cinder::db::sync { - include cinder::params + include ::cinder::params exec { 'cinder-manage db_sync': command => $::cinder::params::db_sync_command, diff --git a/cinder/manifests/init.pp b/cinder/manifests/init.pp index b27a0c171..6a004f258 100644 --- a/cinder/manifests/init.pp +++ b/cinder/manifests/init.pp @@ -196,6 +196,15 @@ # (Optional) # Defaults to '/etc/cinder/api-paste.ini', # +# [*enable_v1_api*] +# (Optional) Whether to enable the v1 API (true/false). +# This will be deprecated in Kilo. +# Defaults to 'true'. +# +# [*enable_v2_api*] +# (Optional) Whether to enable the v1 API (true/false). +# Defaults to 'true'. +# # === Deprecated Parameters # # [*mysql_module*] @@ -250,11 +259,13 @@ $debug = false, $storage_availability_zone = 'nova', $default_availability_zone = false, + $enable_v1_api = true, + $enable_v2_api = true, # DEPRECATED PARAMETERS $mysql_module = undef, ) { - include cinder::params + include ::cinder::params Package['cinder'] -> Cinder_config<||> Package['cinder'] -> Cinder_api_paste_ini<||> @@ -489,4 +500,10 @@ } } + # V1/V2 APIs + cinder_config { + 'DEFAULT/enable_v1_api': value => $enable_v1_api; + 'DEFAULT/enable_v2_api': value => $enable_v2_api; + } + } diff --git a/cinder/manifests/params.pp b/cinder/manifests/params.pp index cffa227a4..9801f66e2 100644 --- a/cinder/manifests/params.pp +++ b/cinder/manifests/params.pp @@ -50,7 +50,7 @@ } } default: { - $iscsi_helper = 'tgtadm' + $iscsi_helper = 'lioadm' } } diff --git a/cinder/manifests/qpid.pp b/cinder/manifests/qpid.pp index a42c5574f..b5eab2a2b 100644 --- a/cinder/manifests/qpid.pp +++ b/cinder/manifests/qpid.pp @@ -51,7 +51,7 @@ $service_ensure = 'stopped' } - class { 'qpid::server': + class { '::qpid::server': service_ensure => $service_ensure } diff --git a/cinder/manifests/scheduler.pp b/cinder/manifests/scheduler.pp index 754fbb742..0884085f0 100644 --- a/cinder/manifests/scheduler.pp +++ b/cinder/manifests/scheduler.pp @@ -28,7 +28,7 @@ $manage_service = true ) { - include cinder::params + include ::cinder::params Cinder_config<||> ~> Service['cinder-scheduler'] Cinder_api_paste_ini<||> ~> Service['cinder-scheduler'] diff --git a/cinder/manifests/type_set.pp b/cinder/manifests/type_set.pp index 3f250b9a0..5b5745373 100644 --- a/cinder/manifests/type_set.pp +++ b/cinder/manifests/type_set.pp @@ -58,7 +58,7 @@ exec {"cinder type-key ${type} set ${key}=${name}": path => ['/usr/bin', '/bin'], command => "cinder type-key ${type} set ${key}=${name}", - unless => "cinder extra-specs-list | grep -Eq '\b${type}\b.*\b${key}\b.*\b${name}\b'", + unless => "cinder extra-specs-list | grep -Eq '\\b${type}\\b.*\\b${key}\\b.*\\b${name}\\b'", environment => concat($cinder_env, $region_env), require => Package['python-cinderclient'] } diff --git a/cinder/manifests/volume.pp b/cinder/manifests/volume.pp index 9ed2fade5..9ab76656e 100644 --- a/cinder/manifests/volume.pp +++ b/cinder/manifests/volume.pp @@ -20,7 +20,7 @@ $manage_service = true ) { - include cinder::params + include ::cinder::params Cinder_config<||> ~> Service['cinder-volume'] Cinder_api_paste_ini<||> ~> Service['cinder-volume'] diff --git a/cinder/manifests/volume/iscsi.pp b/cinder/manifests/volume/iscsi.pp index 777610c7f..0859b1b04 100644 --- a/cinder/manifests/volume/iscsi.pp +++ b/cinder/manifests/volume/iscsi.pp @@ -26,7 +26,7 @@ $iscsi_helper = $::cinder::params::iscsi_helper, ) { - include cinder::params + include ::cinder::params cinder::backend::iscsi { 'DEFAULT': iscsi_ip_address => $iscsi_ip_address, diff --git a/cinder/spec/classes/cinder_spec.rb b/cinder/spec/classes/cinder_spec.rb index d7c68c755..1e625de43 100644 --- a/cinder/spec/classes/cinder_spec.rb +++ b/cinder/spec/classes/cinder_spec.rb @@ -379,4 +379,17 @@ end end + describe 'with APIs set for Kilo (proposed)' do + let :params do + { + :enable_v1_api => false, + :enable_v2_api => true, + :rabbit_password => 'guest', + } + end + + it { should contain_cinder_config('DEFAULT/enable_v1_api').with_value(false) } + it { should contain_cinder_config('DEFAULT/enable_v2_api').with_value(true) } + + end end diff --git a/cinder/spec/classes/cinder_volume_iscsi_spec.rb b/cinder/spec/classes/cinder_volume_iscsi_spec.rb index 93e062245..5352badfc 100644 --- a/cinder/spec/classes/cinder_volume_iscsi_spec.rb +++ b/cinder/spec/classes/cinder_volume_iscsi_spec.rb @@ -49,7 +49,9 @@ end let :facts do - {:osfamily => 'RedHat'} + {:osfamily => 'RedHat', + :operatingsystem => 'RedHat', + :operatingsystemmajrelease => '6'} end it { should contain_file_line('cinder include').with(