CentOS 8 support
- Add yum-centos cookbook to deps - Enable PowerTools and RabbitMQ repositories on EL8 - Update various packages for EL8 Depends-On: https://review.opendev.org/c/openstack/openstack-chef/+/814234 Change-Id: Ife3165204d9ffee132a0daacd4a6f30c7d31378b Signed-off-by: Lance Albertson <lance@osuosl.org>
This commit is contained in:
parent
d50c4ad40d
commit
df9900d25b
@ -43,6 +43,7 @@ The following cookbooks are dependencies:
|
||||
- 'mariadb', '~> 5.0'
|
||||
- 'memcached', '~> 7.0'
|
||||
- 'selinux'
|
||||
- 'yum-centos', '>= 3.2.0'
|
||||
- 'yum-epel'
|
||||
|
||||
Attributes
|
||||
|
@ -122,9 +122,15 @@ default['openstack']['db']['python_packages'] = {
|
||||
case node['platform_family']
|
||||
when 'rhel'
|
||||
default['openstack']['db']['service_type'] = 'mariadb'
|
||||
if node['platform_version'].to_i >= 8
|
||||
default['openstack']['db']['python_packages']['mariadb'] = ['python3-PyMySQL']
|
||||
default['openstack']['db']['python_packages']['percona-cluster'] = ['python3-PyMySQL']
|
||||
default['openstack']['db']['python_packages']['galera'] = ['python3-PyMySQL']
|
||||
else
|
||||
default['openstack']['db']['python_packages']['mariadb'] = ['MySQL-python']
|
||||
default['openstack']['db']['python_packages']['percona-cluster'] = ['MySQL-python']
|
||||
default['openstack']['db']['python_packages']['galera'] = ['MySQL-python']
|
||||
end
|
||||
when 'debian'
|
||||
default['openstack']['db']['service_type'] = 'mariadb'
|
||||
default['openstack']['db']['python_packages']['mariadb'] = ['python3-mysqldb']
|
||||
|
@ -292,7 +292,22 @@ default['openstack']['sysctl']['net.ipv4.conf.default.rp_filter'] = 0
|
||||
|
||||
case node['platform_family']
|
||||
when 'rhel'
|
||||
default['openstack']['common']['platform'] = {
|
||||
default['openstack']['common']['platform'] =
|
||||
if node['platform_version'].to_i >= 8
|
||||
{
|
||||
'common_client_packages' => ['python3-openstackclient'],
|
||||
'python_packages' => %w(
|
||||
python3-pip
|
||||
python3-setuptools
|
||||
python3-virtualenv
|
||||
python3-wheel
|
||||
python36
|
||||
python36-devel
|
||||
),
|
||||
'package_overrides' => '',
|
||||
}
|
||||
else
|
||||
{
|
||||
'common_client_packages' => ['python-openstackclient'],
|
||||
'python_packages' => %w(
|
||||
python
|
||||
@ -304,6 +319,7 @@ when 'rhel'
|
||||
),
|
||||
'package_overrides' => '',
|
||||
}
|
||||
end
|
||||
when 'debian'
|
||||
default['openstack']['common']['platform'] = {
|
||||
'common_client_packages' => ['python3-openstackclient'],
|
||||
|
@ -13,6 +13,7 @@ depends 'etcd', '~> 7.0'
|
||||
depends 'mariadb', '~> 5.0'
|
||||
depends 'memcached', '~> 7.0'
|
||||
depends 'selinux'
|
||||
depends 'yum-centos', '>= 3.2.0'
|
||||
depends 'yum-epel'
|
||||
|
||||
issues_url 'https://launchpad.net/openstack-chef'
|
||||
|
@ -72,8 +72,20 @@ when 'debian'
|
||||
end
|
||||
|
||||
when 'rhel'
|
||||
case node['platform_version'].to_i
|
||||
when 7
|
||||
# TODO(ramereth): These packages conflict with the RDO repo for Train
|
||||
node.default['yum']['epel']['exclude'] = 'python2-qpid-proton python2-pyngus qpid-proton-c'
|
||||
when 8
|
||||
# Need PowerTools repo for some of the python deps
|
||||
node.default['yum']['powertools']['enabled'] = true
|
||||
node.default['yum']['powertools']['managed'] = true
|
||||
# Need to use RabbitMQ repo on EL8
|
||||
node.default['yum']['centos-rabbitmq']['enabled'] = true
|
||||
node.default['yum']['centos-rabbitmq']['managed'] = true
|
||||
|
||||
include_recipe 'yum-centos'
|
||||
end
|
||||
|
||||
include_recipe 'yum-epel'
|
||||
|
||||
@ -111,7 +123,7 @@ when 'rhel'
|
||||
|
||||
package 'centos-release-qemu-ev' do
|
||||
action :upgrade
|
||||
end
|
||||
end if node['platform_version'].to_i < 8
|
||||
end
|
||||
|
||||
# install a python
|
||||
|
@ -1,8 +1,9 @@
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-common::client' do
|
||||
describe 'redhat' do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) }
|
||||
ALL_RHEL.each do |p|
|
||||
context "redhat #{p[:version]}" do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(p) }
|
||||
let(:node) { runner.node }
|
||||
cached(:chef_run) do
|
||||
runner.converge(described_recipe)
|
||||
@ -12,8 +13,16 @@ describe 'openstack-common::client' do
|
||||
expect { chef_run }.to_not raise_error
|
||||
end
|
||||
|
||||
case p
|
||||
when REDHAT_7
|
||||
it do
|
||||
expect(chef_run).to upgrade_package('python-openstackclient')
|
||||
end
|
||||
when REDHAT_8
|
||||
it do
|
||||
expect(chef_run).to upgrade_package('python3-openstackclient')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,8 +1,9 @@
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-common::default' do
|
||||
describe 'rhel-rdo' do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) }
|
||||
ALL_RHEL.each do |p|
|
||||
context "redhat #{p[:version]}" do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(p) }
|
||||
let(:node) { runner.node }
|
||||
cached(:chef_run) do
|
||||
node.override['openstack']['release'] = 'testrelease'
|
||||
@ -13,13 +14,52 @@ describe 'openstack-common::default' do
|
||||
expect { chef_run }.to_not raise_error
|
||||
end
|
||||
|
||||
case p
|
||||
when REDHAT_7
|
||||
pkgs = %w(python python2-pip python2-setuptools python-devel python-virtualenv python-wheel)
|
||||
|
||||
it do
|
||||
expect(chef_run).to upgrade_package('centos-release-qemu-ev')
|
||||
end
|
||||
|
||||
pkgs = %w(python python2-pip python2-setuptools python-devel python-virtualenv python-wheel)
|
||||
it do
|
||||
expect(chef_run).to include_recipe('yum-epel')
|
||||
end
|
||||
|
||||
it 'installs python2 packages' do
|
||||
it do
|
||||
expect(chef_run).to_not include_recipe('yum-centos')
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to create_yum_repository('epel').with(
|
||||
exclude: 'python2-qpid-proton python2-pyngus qpid-proton-c'
|
||||
)
|
||||
end
|
||||
when REDHAT_8
|
||||
pkgs = %w(python3-pip python3-setuptools python3-virtualenv python3-wheel python36 python36-devel)
|
||||
|
||||
it do
|
||||
expect(chef_run).to_not upgrade_package('centos-release-qemu-ev')
|
||||
end
|
||||
|
||||
%w(yum-epel yum-centos).each do |r|
|
||||
it do
|
||||
expect(chef_run).to include_recipe(r)
|
||||
end
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to create_yum_repository('epel').with(exclude: nil)
|
||||
end
|
||||
|
||||
%w(powertools centos-rabbitmq).each do |repo|
|
||||
it do
|
||||
expect(chef_run).to create_yum_repository(repo).with(enabled: true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to upgrade_package(pkgs)
|
||||
end
|
||||
|
||||
@ -31,15 +71,8 @@ describe 'openstack-common::default' do
|
||||
runner.converge(described_recipe)
|
||||
end
|
||||
|
||||
it 'adds RDO yum repository' do
|
||||
# Using cookbook(yum) LWRP custom matcher
|
||||
# https://github.com/sethvargo/chefspec#packaging-custom-matchers
|
||||
expect(chef_run).to add_yum_repository('RDO-testrelease')
|
||||
.with(gpgcheck: true)
|
||||
end
|
||||
|
||||
it 'does include yum-epel recipe' do
|
||||
expect(chef_run).to include_recipe('yum-epel')
|
||||
it do
|
||||
expect(chef_run).to add_yum_repository('RDO-testrelease').with(gpgcheck: true)
|
||||
end
|
||||
end
|
||||
|
||||
@ -51,13 +84,8 @@ describe 'openstack-common::default' do
|
||||
runner.converge(described_recipe)
|
||||
end
|
||||
|
||||
it 'adds RDO yum repository' do
|
||||
expect(chef_run).to add_yum_repository('RDO-testrelease')
|
||||
.with(gpgcheck: false)
|
||||
end
|
||||
|
||||
it 'does include yum-epel recipe' do
|
||||
expect(chef_run).to include_recipe('yum-epel')
|
||||
it do
|
||||
expect(chef_run).to add_yum_repository('RDO-testrelease').with(gpgcheck: false)
|
||||
end
|
||||
end
|
||||
|
||||
@ -85,9 +113,6 @@ describe 'openstack-common::default' do
|
||||
allow(FileTest).to receive(:exist?).with('/etc/yum.repos.d/RDO-testrelease.repo').and_return(true)
|
||||
expect(chef_run).to remove_yum_repository('RDO-testrelease')
|
||||
end
|
||||
it 'does include yum-epel recipe' do
|
||||
expect(chef_run).to include_recipe('yum-epel')
|
||||
end
|
||||
|
||||
it 'does not create RDO-Manager yum repositories' do
|
||||
expect(chef_run).to_not create_remote_file('/etc/yum.repos.d/rdo-manager-release.repo')
|
||||
@ -107,4 +132,5 @@ describe 'openstack-common::default' do
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -12,11 +12,21 @@ UBUNTU_OPTS = {
|
||||
version: '18.04',
|
||||
}.freeze
|
||||
|
||||
REDHAT_OPTS = {
|
||||
REDHAT_7 = {
|
||||
platform: 'redhat',
|
||||
version: '7',
|
||||
}.freeze
|
||||
|
||||
REDHAT_8 = {
|
||||
platform: 'redhat',
|
||||
version: '8',
|
||||
}.freeze
|
||||
|
||||
ALL_RHEL = [
|
||||
REDHAT_7,
|
||||
REDHAT_8,
|
||||
].freeze
|
||||
|
||||
# We set a default platform for non-platform specific test cases
|
||||
CHEFSPEC_OPTS = UBUNTU_OPTS
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user