diff --git a/attributes/default.rb b/attributes/default.rb index d680950..7ed723e 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -336,6 +336,7 @@ when 'fedora', 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this 'cinder_nfs_packages' => ['nfs-utils', 'nfs-utils-lib'], 'cinder_emc_packages' => ['pywbem'], 'cinder_svc_packages' => ['sysfsutils'], + 'cinder_lvm_packages' => ['lvm2'], 'cinder_flashsystem_packages' => ['sysfsutils'], 'package_overrides' => '' } @@ -358,6 +359,7 @@ when 'suse' 'cinder_nfs_packages' => ['nfs-utils'], 'cinder_emc_packages' => ['python-pywbem'], 'cinder_svc_packages' => ['sysfsutils'], + 'cinder_lvm_packages' => ['lvm2'], 'cinder_flashsystem_packages' => ['sysfsutils'] } when 'debian' @@ -379,6 +381,7 @@ when 'debian' 'cinder_nfs_packages' => ['nfs-common'], 'cinder_emc_packages' => ['python-pywbem'], 'cinder_svc_packages' => ['sysfsutils'], + 'cinder_lvm_packages' => ['lvm2'], 'cinder_flashsystem_packages' => ['sysfsutils'], 'package_overrides' => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'" } diff --git a/recipes/volume.rb b/recipes/volume.rb index d99d4e9..b334848 100644 --- a/recipes/volume.rb +++ b/recipes/volume.rb @@ -171,6 +171,13 @@ when 'cinder.volume.drivers.ibm.ibmnas.IBMNAS_NFSDriver' when 'cinder.volume.drivers.lvm.LVMISCSIDriver' + platform_options['cinder_lvm_packages'].each do |pkg| + package pkg do + options platform_options['package_overrides'] + action :upgrade + end + end + if node['openstack']['block-storage']['volume']['create_volume_group'] vg_name = node['openstack']['block-storage']['volume']['volume_group'] diff --git a/spec/volume_spec.rb b/spec/volume_spec.rb index 28d6c3c..f891089 100644 --- a/spec/volume_spec.rb +++ b/spec/volume_spec.rb @@ -243,6 +243,10 @@ describe 'openstack-block-storage::volume' do stub_command('vgs cinder-volumes').and_return(false) end + it 'upgrades lvm packages' do + expect(chef_run).to upgrade_package 'lvm2' + end + it 'cinder vg active' do expect(chef_run).to enable_service 'cinder-group-active' end