diff --git a/CHANGELOG.md b/CHANGELOG.md index e232970..193345b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ openstack-block-storage Cookbook CHANGELOG ============================== This file is used to list changes made in each version of the openstack-block-storage cookbook. +## 10.1.0 +* Add disable logic for stage fix to tgtd issue on RHEL 7 + ## 10.0.1 # Update cinder.conf mode from 0644 to 0640 * Add attribute for ibmnas_platform_type diff --git a/attributes/default.rb b/attributes/default.rb index ab14392..291586e 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -319,6 +319,13 @@ when 'fedora', 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this 'cinder_svc_packages' => ['sysfsutils'], 'package_overrides' => '' } + if platform_family == 'rhel' && platform_version.to_i == 7 + # On RHEL7, tgtd has been removed, disable it here just for now. + # This is a stage fix for bug #1400958, new logic should be added to fully + # support new targetcli on RHEL7 + default['openstack']['block-storage']['platform']['cinder_iscsitarget_packages'] = [] + default['openstack']['block-storage']['platform']['cinder_iscsitarget_service'] = [] + end when 'suse' # operating system user and group names default['openstack']['block-storage']['user'] = 'openstack-cinder' diff --git a/metadata.rb b/metadata.rb index 6b13a34..1742a7e 100644 --- a/metadata.rb +++ b/metadata.rb @@ -5,7 +5,7 @@ maintainer_email 'opscode-chef-openstack@googlegroups.com' license 'Apache 2.0' description 'The OpenStack Advanced Volume Management service Cinder.' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '10.0.1' +version '10.1.0' recipe 'openstack-block-storage::api', 'Installs the cinder-api, sets up the cinder database, and cinder service/user/endpoints in keystone' recipe 'openstack-block-storage::client', 'Install packages required for cinder client' diff --git a/recipes/volume.rb b/recipes/volume.rb index 8280032..f393d64 100644 --- a/recipes/volume.rb +++ b/recipes/volume.rb @@ -233,14 +233,19 @@ service 'cinder-volume' do subscribes :restart, 'template[/etc/cinder/cinder.conf]' end -service 'iscsitarget' do - service_name platform_options['cinder_iscsitarget_service'] - supports status: true, restart: true - action :enable -end +unless node['platform_family'] == 'rhel' && node['platform_version'].to_i == 7 + # On RHEL7, tgtd has been removed, disable it here just for now. + # This is a stage fix for bug #1400958, new logic should be added to fully + # support new targetcli on RHEL7 + service 'iscsitarget' do + service_name platform_options['cinder_iscsitarget_service'] + supports status: true, restart: true + action :enable + end -template '/etc/tgt/targets.conf' do - source 'targets.conf.erb' - mode 00600 - notifies :restart, 'service[iscsitarget]', :immediately + template '/etc/tgt/targets.conf' do + source 'targets.conf.erb' + mode 00600 + notifies :restart, 'service[iscsitarget]', :immediately + end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 045fda5..7ab831d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -20,6 +20,11 @@ REDHAT_OPTS = { version: '6.5', log_level: LOG_LEVEL } +REDHAT7_OPTS = { + platform: 'redhat', + version: '7.0', + log_level: LOG_LEVEL +} UBUNTU_OPTS = { platform: 'ubuntu', version: '12.04', diff --git a/spec/volume-redhat_spec.rb b/spec/volume-redhat_spec.rb index 3a52efc..ca1caa9 100644 --- a/spec/volume-redhat_spec.rb +++ b/spec/volume-redhat_spec.rb @@ -189,4 +189,20 @@ describe 'openstack-block-storage::volume' do end end + + describe 'redhat' do + let(:runner) { ChefSpec::Runner.new(REDHAT7_OPTS) } + let(:node) { runner.node } + let(:chef_run) { runner.converge(described_recipe) } + + include_context 'block-storage-stubs' + + it 'disable tgtd for rhel7' do + # test temp solution for RHEL7 to disable tgtd + # stage fix for bug #1400958 + expect(chef_run).not_to upgrade_package('scsi-target-utils') + expect(chef_run).not_to enable_service('iscsitarget') + expect(chef_run).not_to create_template('/etc/tgt/targets.conf') + end + end end