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:
		| @@ -1,6 +1,9 @@ | |||||||
| openstack-block-storage Cookbook CHANGELOG | openstack-block-storage Cookbook CHANGELOG | ||||||
| ============================== | ============================== | ||||||
| This file is used to list changes made in each version of the openstack-block-storage cookbook. | 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 | ## 10.0.1 | ||||||
| # Update cinder.conf mode from 0644 to 0640 | # Update cinder.conf mode from 0644 to 0640 | ||||||
| * Add attribute for ibmnas_platform_type | * Add attribute for ibmnas_platform_type | ||||||
|   | |||||||
| @@ -319,6 +319,13 @@ when 'fedora', 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this | |||||||
|     'cinder_svc_packages' => ['sysfsutils'], |     'cinder_svc_packages' => ['sysfsutils'], | ||||||
|     'package_overrides' => '' |     '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' | when 'suse' | ||||||
|   # operating system user and group names |   # operating system user and group names | ||||||
|   default['openstack']['block-storage']['user'] = 'openstack-cinder' |   default['openstack']['block-storage']['user'] = 'openstack-cinder' | ||||||
|   | |||||||
| @@ -5,7 +5,7 @@ maintainer_email 'opscode-chef-openstack@googlegroups.com' | |||||||
| license          'Apache 2.0' | license          'Apache 2.0' | ||||||
| description      'The OpenStack Advanced Volume Management service Cinder.' | description      'The OpenStack Advanced Volume Management service Cinder.' | ||||||
| long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) | 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::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' | recipe           'openstack-block-storage::client', 'Install packages required for cinder client' | ||||||
|   | |||||||
| @@ -233,14 +233,19 @@ service 'cinder-volume' do | |||||||
|   subscribes :restart, 'template[/etc/cinder/cinder.conf]' |   subscribes :restart, 'template[/etc/cinder/cinder.conf]' | ||||||
| end | end | ||||||
|  |  | ||||||
| service 'iscsitarget' do | unless node['platform_family'] == 'rhel' && node['platform_version'].to_i == 7 | ||||||
|   service_name platform_options['cinder_iscsitarget_service'] |   # On RHEL7, tgtd has been removed, disable it here just for now. | ||||||
|   supports status: true, restart: true |   # This is a stage fix for bug #1400958, new logic should be added to fully | ||||||
|   action :enable |   # support new targetcli on RHEL7 | ||||||
| end |   service 'iscsitarget' do | ||||||
|  |     service_name platform_options['cinder_iscsitarget_service'] | ||||||
|  |     supports status: true, restart: true | ||||||
|  |     action :enable | ||||||
|  |   end | ||||||
|  |  | ||||||
| template '/etc/tgt/targets.conf' do |   template '/etc/tgt/targets.conf' do | ||||||
|   source 'targets.conf.erb' |     source 'targets.conf.erb' | ||||||
|   mode   00600 |     mode   00600 | ||||||
|   notifies :restart, 'service[iscsitarget]', :immediately |     notifies :restart, 'service[iscsitarget]', :immediately | ||||||
|  |   end | ||||||
| end | end | ||||||
|   | |||||||
| @@ -20,6 +20,11 @@ REDHAT_OPTS = { | |||||||
|   version: '6.5', |   version: '6.5', | ||||||
|   log_level: LOG_LEVEL |   log_level: LOG_LEVEL | ||||||
| } | } | ||||||
|  | REDHAT7_OPTS = { | ||||||
|  |   platform: 'redhat', | ||||||
|  |   version: '7.0', | ||||||
|  |   log_level: LOG_LEVEL | ||||||
|  | } | ||||||
| UBUNTU_OPTS = { | UBUNTU_OPTS = { | ||||||
|   platform: 'ubuntu', |   platform: 'ubuntu', | ||||||
|   version: '12.04', |   version: '12.04', | ||||||
|   | |||||||
| @@ -189,4 +189,20 @@ describe 'openstack-block-storage::volume' do | |||||||
|     end |     end | ||||||
|  |  | ||||||
|   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 | end | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Yi Ming Yin
					Yi Ming Yin