Disable configuration of tgtd on RHEL 7

- This is a stage I fix for bug #1400958. First disable the related
resources for tgtd.
- Bump version to 10.1.0 to indicate this is a start point of new
platform support

Change-Id: Id3757f7847ba0620d4bf4492160921389e3ef475
Partial-bug: #1400958
This commit is contained in:
Yi Ming Yin 2014-12-17 11:19:56 +08:00
parent e726f9b93f
commit dad180e458
6 changed files with 46 additions and 10 deletions

View File

@ -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

View File

@ -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'

View File

@ -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'

View File

@ -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

View File

@ -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',

View File

@ -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