From 7d2ecf253c87e2786e507285cbb66dda085de104 Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Fri, 15 Oct 2021 15:06:08 -0700 Subject: [PATCH] CentOS 8 support This adds support for testing CentOS 8. - Update documentation - Add references to CentOS 8 - Update genealogy to include latest releases - Update minimum Chef requirement - Add Bare Metal to list of cookbooks when creating a stable branch - Include memcached in identity role - Update InSpec tests for CentOS 8 - Ensure we install the yum package on rpm distros (required by Chef to run properly and is missing on the default image) - Remove yum-epel attributes in integration since it breaks on EL8 Change-Id: Ie648432021325150fdd2fd7ab7f1af10bc69b655 Signed-off-by: Lance Albertson --- .zuul.yaml | 113 ++++++++++++------ README.rst | 2 +- Rakefile | 6 +- bindep.txt | 1 + deploy-guide/source/deploy.rst | 2 +- deploy-guide/source/genealogy.rst | 6 + deploy-guide/source/supported-platforms.rst | 4 +- .../contributor/create-stable-branch.rst | 1 + environments/integration.json | 7 -- kitchen.yml | 3 + roles/identity.json | 1 + test/integration/common/inspec/common_spec.rb | 42 +++++-- .../integration/inspec/integration_spec.rb | 17 ++- .../network/inspec/network_spec.rb | 11 +- .../inspec/ops_messaging_spec.rb | 9 +- 15 files changed, 159 insertions(+), 66 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index fe53057..050b3a5 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -33,16 +33,10 @@ voting: false # TODO(ramereth): Remove after this gets merged - job: - name: openstack-chef16-minimal-integration-ubuntu - parent: openstack-chef-minimal-integration-ubuntu - vars: - openstack_chef_client_version: 16 - -- job: - name: openstack-chef-integration-centos + name: openstack-chef-integration-centos-8 parent: base - nodeset: centos-7 - description: Run integration tests with openstack-chef on CentOS 7 + nodeset: centos-8 + description: Run integration tests with openstack-chef on CentOS required-projects: openstack/openstack-chef pre-run: playbooks/pre-integration.yaml run: playbooks/integration.yaml @@ -51,10 +45,10 @@ voting: false # TODO(ramereth): Remove after this gets merged - job: - name: openstack-chef-minimal-integration-centos + name: openstack-chef-minimal-integration-centos-8 parent: base - nodeset: centos-7 - description: Run minimal integration tests with openstack-chef on CentOS 7 + nodeset: centos-8 + description: Run minimal integration tests with openstack-chef on CentOS required-projects: openstack/openstack-chef pre-run: playbooks/pre-integration.yaml run: playbooks/minimal.yaml @@ -63,8 +57,30 @@ voting: false # TODO(ramereth): Remove after this gets merged - job: - name: openstack-chef16-minimal-integration-centos - parent: openstack-chef-minimal-integration-centos + name: openstack-chef16-minimal-integration-ubuntu + parent: openstack-chef-minimal-integration-ubuntu + vars: + openstack_chef_client_version: 16 + +- job: + name: openstack-chef-integration-centos-7 + parent: openstack-chef-integration-centos-8 + nodeset: centos-7 + +- job: + name: openstack-chef-minimal-integration-centos-7 + parent: openstack-chef-minimal-integration-centos-8 + nodeset: centos-7 + +- job: + name: openstack-chef16-minimal-integration-centos-7 + parent: openstack-chef-minimal-integration-centos-7 + vars: + openstack_chef_client_version: 16 + +- job: + name: openstack-chef16-minimal-integration-centos-8 + parent: openstack-chef-minimal-integration-centos-8 vars: openstack_chef_client_version: 16 @@ -82,15 +98,28 @@ openstack_chef_client_type: cinc - job: - name: openstack-cinc16-integration-centos - parent: openstack-chef-integration-centos + name: openstack-cinc16-integration-centos-7 + parent: openstack-chef-integration-centos-7 vars: openstack_chef_client_type: cinc openstack_chef_client_version: 16 - job: - name: openstack-cinc-integration-centos - parent: openstack-chef-integration-centos + name: openstack-cinc16-integration-centos-8 + parent: openstack-chef-integration-centos-8 + vars: + openstack_chef_client_type: cinc + openstack_chef_client_version: 16 + +- job: + name: openstack-cinc-integration-centos-7 + parent: openstack-chef-integration-centos-7 + vars: + openstack_chef_client_type: cinc + +- job: + name: openstack-cinc-integration-centos-8 + parent: openstack-chef-integration-centos-8 vars: openstack_chef_client_type: cinc @@ -99,21 +128,27 @@ check: jobs: - openstack-chef-delivery - - openstack-chef-integration-centos + - openstack-chef-integration-centos-7 + - openstack-chef-integration-centos-8 - openstack-chef-integration-ubuntu - - openstack-cinc16-integration-centos + - openstack-cinc16-integration-centos-7 + - openstack-cinc16-integration-centos-8 - openstack-cinc16-integration-ubuntu - - openstack-cinc-integration-centos + - openstack-cinc-integration-centos-8 + - openstack-cinc-integration-centos-7 - openstack-cinc-integration-ubuntu gate: queue: openstack-chef jobs: - openstack-chef-delivery - - openstack-chef-integration-centos + - openstack-chef-integration-centos-7 + - openstack-chef-integration-centos-8 - openstack-chef-integration-ubuntu - - openstack-cinc16-integration-centos + - openstack-cinc16-integration-centos-7 + - openstack-cinc16-integration-centos-8 - openstack-cinc16-integration-ubuntu - - openstack-cinc-integration-centos + - openstack-cinc-integration-centos-7 + - openstack-cinc-integration-centos-8 - openstack-cinc-integration-ubuntu - project-template: @@ -121,29 +156,39 @@ check: jobs: - openstack-chef-delivery - - openstack-chef-integration-centos + - openstack-chef-integration-centos-7 + - openstack-chef-integration-centos-8 - openstack-chef-integration-ubuntu - - openstack-chef-minimal-integration-centos + - openstack-chef-minimal-integration-centos-7 + - openstack-chef-minimal-integration-centos-8 - openstack-chef-minimal-integration-ubuntu - - openstack-chef16-minimal-integration-centos + - openstack-chef16-minimal-integration-centos-7 + - openstack-chef16-minimal-integration-centos-8 - openstack-chef16-minimal-integration-ubuntu - - openstack-cinc16-integration-centos + - openstack-cinc16-integration-centos-7 + - openstack-cinc16-integration-centos-8 - openstack-cinc16-integration-ubuntu - - openstack-cinc-integration-centos + - openstack-cinc-integration-centos-7 + - openstack-cinc-integration-centos-8 - openstack-cinc-integration-ubuntu gate: queue: openstack-chef jobs: - openstack-chef-delivery - - openstack-chef-integration-centos + - openstack-chef-integration-centos-7 + - openstack-chef-integration-centos-8 - openstack-chef-integration-ubuntu - - openstack-chef-minimal-integration-centos + - openstack-chef-minimal-integration-centos-7 + - openstack-chef-minimal-integration-centos-8 - openstack-chef-minimal-integration-ubuntu - - openstack-chef16-minimal-integration-centos + - openstack-chef16-minimal-integration-centos-7 + - openstack-chef16-minimal-integration-centos-8 - openstack-chef16-minimal-integration-ubuntu - - openstack-cinc16-integration-centos + - openstack-cinc16-integration-centos-7 + - openstack-cinc16-integration-centos-8 - openstack-cinc16-integration-ubuntu - - openstack-cinc-integration-centos + - openstack-cinc-integration-centos-7 + - openstack-cinc-integration-centos-8 - openstack-cinc-integration-ubuntu - project: diff --git a/README.rst b/README.rst index 5ff8dff..e4a88e7 100644 --- a/README.rst +++ b/README.rst @@ -18,7 +18,7 @@ Chef. With the ``master`` branch of the cookbooks, which is currently tied to the base OpenStack Train release, this supports deploying to Ubuntu -18.04 and CentOS 7 in monolithic, or allinone, and non-HA multinode +18.04 and CentOS 7 or 8 in monolithic, or allinone, and non-HA multinode configurations with Neutron. The cookbooks support a fully HA configuration, but we do not test for that as there are far numerous paths to HA. diff --git a/Rakefile b/Rakefile index 369623e..7a6b971 100644 --- a/Rakefile +++ b/Rakefile @@ -80,6 +80,8 @@ if File.exist?('/usr/bin/apt-get') @platform = 'ubuntu18' elsif File.exist?('/usr/bin/yum') @platform = 'centos7' +elsif File.exist?('/usr/bin/dnf') + @platform = 'centos8' end # Helper for looking at the starting environment @@ -107,7 +109,7 @@ def _run_env_queries }, false ) - when 'centos7' + when 'centos7', 'centos8' _run_commands( 'basic rhel env queries', { '/sbin/getenforce' => [''], @@ -126,7 +128,7 @@ def _save_logs(prefix, log_dir) case @platform when 'ubuntu18' sh %(sudo /bin/ss -tunlp > #{log_dir}/#{prefix}/netstat.log) - when 'centos7' + when 'centos7', 'centos8' sh %(sudo /sbin/ss -tunlp > #{log_dir}/#{prefix}/netstat.log) end %w( diff --git a/bindep.txt b/bindep.txt index 58c573e..26b4fe5 100644 --- a/bindep.txt +++ b/bindep.txt @@ -4,3 +4,4 @@ xz-devel [platform:rpm] zlib1g-dev [platform:dpkg] zlib-devel [platform:rpm] libselinux-utils [platform:rpm] +yum [platform:rpm] diff --git a/deploy-guide/source/deploy.rst b/deploy-guide/source/deploy.rst index 4261a73..321981f 100644 --- a/deploy-guide/source/deploy.rst +++ b/deploy-guide/source/deploy.rst @@ -9,7 +9,7 @@ Tempest. * Software requirements: - * Ubuntu 18.04 LTS or CentOS 7 fresh install + * Ubuntu 18.04 LTS or CentOS 7 or 8 fresh install * `git` installed * `chef-client` installed: https://docs.chef.io/#setup diff --git a/deploy-guide/source/genealogy.rst b/deploy-guide/source/genealogy.rst index 9b5b9aa..1b4bbdb 100644 --- a/deploy-guide/source/genealogy.rst +++ b/deploy-guide/source/genealogy.rst @@ -44,6 +44,12 @@ Releases Summary +----------------------------+------------------------------+------------------------+ | 22.y.z | Victoria | Future | +----------------------------+------------------------------+------------------------+ +| 23.y.z | Wallaby | Future | ++----------------------------+------------------------------+------------------------+ +| 24.y.z | Xena | Future | ++----------------------------+------------------------------+------------------------+ +| 25.y.z | Yoga | Future | ++----------------------------+------------------------------+------------------------+ Supermarket releases ==================== diff --git a/deploy-guide/source/supported-platforms.rst b/deploy-guide/source/supported-platforms.rst index 2097866..2e5c5e6 100644 --- a/deploy-guide/source/supported-platforms.rst +++ b/deploy-guide/source/supported-platforms.rst @@ -4,12 +4,12 @@ Supported Platforms The following operating systems and versions are supported by the OpenStack cookbooks: * Ubuntu 18.04 LTS (Bionic Beaver) -* CentOS 7 +* CentOS 7 or 8 The cookbooks are tested and verified to work on the Chef stable track using the `Chef Workstation `_. -Your success rate may vary with the bleeding edge. Chef 14 and older is NOT +Your success rate may vary with the bleeding edge. Chef 15 and older is NOT supported. Have a look at diff --git a/doc/source/contributor/create-stable-branch.rst b/doc/source/contributor/create-stable-branch.rst index 05b27ee..ff1ed62 100644 --- a/doc/source/contributor/create-stable-branch.rst +++ b/doc/source/contributor/create-stable-branch.rst @@ -136,6 +136,7 @@ their ``metadata.rb`` dependencies. See below on specifics: #. Network (depends on Identity) #. Compute (depends on Image and Network) #. Dns (depends on Network) +#. Bare Metal (depends on Image and Network) #. Orchestration (depends on Identity) #. Telemetry (depends on Identity) #. Dashboard (depends on Identity) diff --git a/environments/integration.json b/environments/integration.json index 833cfa7..5157faa 100644 --- a/environments/integration.json +++ b/environments/integration.json @@ -15,13 +15,6 @@ } } } - }, - "yum": { - "epel": { - "baseurl": "http://epel.osuosl.org/7/$basearch", - "mirrorlist": null, - "gpgkey": "http://epel.osuosl.org/RPM-GPG-KEY-EPEL-7" - } } }, "override_attributes": { diff --git a/kitchen.yml b/kitchen.yml index ac05b3d..bdc7c35 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -47,6 +47,9 @@ platforms: - name: centos-7 driver: box: bento/centos-7 + - name: centos-8 + driver: + box: bento/centos-8 suites: - name: default diff --git a/roles/identity.json b/roles/identity.json index 4424c0f..802ba32 100644 --- a/roles/identity.json +++ b/roles/identity.json @@ -5,6 +5,7 @@ "role[common]", "role[ops_database]", "role[ops_messaging]", + "recipe[memcached]", "recipe[openstack-identity::server-apache]", "recipe[openstack-identity::registration]", "recipe[openstack-identity::openrc]" diff --git a/test/integration/common/inspec/common_spec.rb b/test/integration/common/inspec/common_spec.rb index cd36eaf..d47825e 100644 --- a/test/integration/common/inspec/common_spec.rb +++ b/test/integration/common/inspec/common_spec.rb @@ -7,11 +7,12 @@ describe kernel_parameter 'net.ipv4.conf.default.rp_filter' do end os_family = os.family +os_release = os.release.to_i describe command 'openstack --version' do its('exit_status') { should eq 0 } # RHEL sends output to stderr while Ubuntu sends it to stdout - if os_family == 'redhat' + if os_family == 'redhat' && os_release == 7 its('stderr') { should match /^openstack 4.0.[0-9]+$/ } else its('stdout') { should match /^openstack 4.0.[0-9]+$/ } @@ -19,18 +20,33 @@ describe command 'openstack --version' do end if os.family == 'redhat' - %w( - centos-release-qemu-ev - python - python2-openstackclient - python2-pip - python2-setuptools - python2-wheel - python-devel - python-virtualenv - ).each do |pkg| - describe package pkg do - it { should be_installed } + if os_release >= 8 + %w( + python3-pip + python3-setuptools + python3-virtualenv + python3-wheel + python36 + python36-devel + ).each do |pkg| + describe package pkg do + it { should be_installed } + end + end + else + %w( + centos-release-qemu-ev + python + python2-openstackclient + python2-pip + python2-setuptools + python2-wheel + python-devel + python-virtualenv + ).each do |pkg| + describe package pkg do + it { should be_installed } + end end end diff --git a/test/integration/integration/inspec/integration_spec.rb b/test/integration/integration/inspec/integration_spec.rb index e2ce984..6a71662 100644 --- a/test/integration/integration/inspec/integration_spec.rb +++ b/test/integration/integration/inspec/integration_spec.rb @@ -1,5 +1,6 @@ openrc = 'bash -c "source /root/openrc && ' platform = os.family +os_release = os.release.to_i describe command "#{openrc} openstack network show local_net -f shell -c admin_state_up -c status\"" do its('exit_status') { should eq 0 } @@ -15,8 +16,14 @@ describe command "#{openrc} openstack subnet show local_subnet -f shell -c enabl should include 'allocation_pools="[{\'start\': \'192.168.180.2\', \'end\': \'192.168.180.254\'}]"' end when 'redhat' - its('stdout') do - should include 'allocation_pools="[{u\'start\': u\'192.168.180.2\', u\'end\': u\'192.168.180.254\'}]' + if os_release >= 8 + its('stdout') do + should include 'allocation_pools="[{\'start\': \'192.168.180.2\', \'end\': \'192.168.180.254\'}]"' + end + else + its('stdout') do + should include 'allocation_pools="[{u\'start\': u\'192.168.180.2\', u\'end\': u\'192.168.180.254\'}]' + end end end its('stdout') { should include 'cidr="192.168.180.0/24"' } @@ -87,7 +94,11 @@ describe command '/opt/tempest-venv/bin/tempest --version' do its('exit_status') { should eq 0 } case os_family when 'redhat' - its('stderr') { should match /^tempest 22.1.0$/ } + if os_release >= 8 + its('stdout') { should match /^tempest 22.1.0$/ } + else + its('stderr') { should match /^tempest 22.1.0$/ } + end when 'debian' its('stdout') { should match /^tempest 22.1.0$/ } end diff --git a/test/integration/network/inspec/network_spec.rb b/test/integration/network/inspec/network_spec.rb index 36c23e4..b08d957 100644 --- a/test/integration/network/inspec/network_spec.rb +++ b/test/integration/network/inspec/network_spec.rb @@ -1,5 +1,6 @@ openrc = 'bash -c "source /root/openrc && ' platform = os.family +os_release = os.release.to_i %w( 9696 @@ -38,8 +39,14 @@ describe command "#{openrc} openstack subnet show local_subnet -f shell -c enabl should include 'allocation_pools="[{\'start\': \'192.168.180.2\', \'end\': \'192.168.180.254\'}]"' end when 'redhat' - its('stdout') do - should include 'allocation_pools="[{u\'start\': u\'192.168.180.2\', u\'end\': u\'192.168.180.254\'}]' + if os_release >= 8 + its('stdout') do + should include 'allocation_pools="[{\'start\': \'192.168.180.2\', \'end\': \'192.168.180.254\'}]"' + end + else + its('stdout') do + should include 'allocation_pools="[{u\'start\': u\'192.168.180.2\', u\'end\': u\'192.168.180.254\'}]' + end end end its('stdout') { should include 'cidr="192.168.180.0/24"' } diff --git a/test/integration/ops-messaging/inspec/ops_messaging_spec.rb b/test/integration/ops-messaging/inspec/ops_messaging_spec.rb index ecc0963..186553c 100644 --- a/test/integration/ops-messaging/inspec/ops_messaging_spec.rb +++ b/test/integration/ops-messaging/inspec/ops_messaging_spec.rb @@ -13,7 +13,14 @@ describe command 'rabbitmqctl list_users' do its('stdout') { should match /admin\t\[administrator\]\n/ } end +os_release = os.release.to_i +os_family = os.family + describe command 'rabbitmqctl list_vhosts' do its('exit_status') { should eq 0 } - its('stdout') { should match %r{^Listing vhosts\n/\n$} } + if os_release >= 8 && os_family == 'redhat' + its('stdout') { should match %r{^Listing vhosts ...\nname\n/\n$} } + else + its('stdout') { should match %r{^Listing vhosts\n/\n$} } + end end