From 8a5700cd1e81f56e1b28ef9529922a37e946ffec Mon Sep 17 00:00:00 2001 From: Joel Capitao Date: Mon, 7 Jun 2021 17:51:34 +0200 Subject: [PATCH] Add CentOS Stream 9 preview support CentOS is publishing some preview composes of CentOS Stream 9. In RDO, we are working to get ready for it ASAP. This patch is proposing some changes needed for current status of CentOS9 so that i can use this patch for it: - Set rsync to be executed without xinetd (xinetd is not in CS9) - Added the creation of initiatorname.iscsi using openstacklib::iscsid It's also creating packstack-centos9 and packstack-multinode-centos9 base jobs so that we can start running packstack jobs in third-party zuul servers. Change-Id: I64edd1876ccc32f98ab2330024d9ab513f42a158 --- .zuul.yaml | 21 +++++++++++++++ .../packstack/manifests/swift/ringbuilder.pp | 14 +++++++--- packstack/puppet/templates/compute.pp | 4 +++ packstack/puppet/templates/controller.pp | 1 + playbooks/packstack-centos9-pre.yaml | 27 +++++++++++++++++++ playbooks/packstack-post-compute.yaml | 2 +- run_tests.sh | 14 ++++++---- 7 files changed, 74 insertions(+), 9 deletions(-) create mode 100644 playbooks/packstack-centos9-pre.yaml diff --git a/.zuul.yaml b/.zuul.yaml index aa67f5be2..f22100ce3 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -60,6 +60,16 @@ label: centos-8-stream run: playbooks/packstack-integration-tempest.yaml +- job: + name: packstack-centos9 + parent: packstack-base + vars: + selinux_enforcing: "false" + delorean: "https://trunk.rdoproject.org/centos9-master/current/delorean.repo" + delorean_deps: "https://trunk.rdoproject.org/centos9-master/delorean-deps.repo" + pre-run: playbooks/packstack-centos9-pre.yaml + run: playbooks/packstack-integration-tempest.yaml + - job: name: packstack-multinode-centos8s parent: packstack-base @@ -76,6 +86,17 @@ label: centos-8-stream run: playbooks/packstack-multinode.yaml +- job: + name: packstack-multinode-centos9 + parent: packstack-base + vars: + selinux_enforcing: "false" + delorean: "https://trunk.rdoproject.org/centos9-master/current/delorean.repo" + delorean_deps: "https://trunk.rdoproject.org/centos9-master/delorean-deps.repo" + pre-run: playbooks/packstack-centos9-pre.yaml + post-run: playbooks/packstack-post-compute.yaml + run: playbooks/packstack-multinode.yaml + - job: name: packstack-centos8s-integration-scenario001 parent: packstack-centos8s diff --git a/packstack/puppet/modules/packstack/manifests/swift/ringbuilder.pp b/packstack/puppet/modules/packstack/manifests/swift/ringbuilder.pp index 584b17024..aeb70a04a 100644 --- a/packstack/puppet/modules/packstack/manifests/swift/ringbuilder.pp +++ b/packstack/puppet/modules/packstack/manifests/swift/ringbuilder.pp @@ -7,9 +7,17 @@ class packstack::swift::ringbuilder () require => Class['swift'], } - # sets up an rsync db that can be used to sync the ring DB - class { 'swift::ringserver': - local_net_ip => hiera('CONFIG_STORAGE_HOST_URL'), + if ($::operatingsystem == 'CentOS') and (versioncmp($::operatingsystemmajrelease, '9') == 0) { + # sets up an rsync db that can be used to sync the ring DB + class { 'swift::ringserver': + local_net_ip => hiera('CONFIG_STORAGE_HOST_URL'), + rsync_use_xinetd => false, + } + } else { + # sets up an rsync db that can be used to sync the ring DB + class { 'swift::ringserver': + local_net_ip => hiera('CONFIG_STORAGE_HOST_URL'), + } } if str2bool($::selinux) { diff --git a/packstack/puppet/templates/compute.pp b/packstack/puppet/templates/compute.pp index 3fa2ea6a8..789d25bed 100644 --- a/packstack/puppet/templates/compute.pp +++ b/packstack/puppet/templates/compute.pp @@ -32,6 +32,10 @@ if hiera('CONFIG_VMWARE_BACKEND') == 'y' { include 'packstack::nova::compute::libvirt' } +if hiera('CONFIG_CINDER_INSTALL') == 'y' { + include 'openstacklib::iscsid' +} + if hiera('CONFIG_CINDER_INSTALL') == 'y' and hiera('CONFIG_VMWARE_BACKEND') != 'y' { if 'nfs' in hiera_array('CONFIG_CINDER_BACKEND') { diff --git a/packstack/puppet/templates/controller.pp b/packstack/puppet/templates/controller.pp index ba3005970..1d84bb32b 100644 --- a/packstack/puppet/templates/controller.pp +++ b/packstack/puppet/templates/controller.pp @@ -39,6 +39,7 @@ if hiera('CONFIG_GLANCE_INSTALL') == 'y' { } if hiera('CONFIG_CINDER_INSTALL') == 'y' { + include 'openstacklib::iscsid' include 'packstack::keystone::cinder' include 'packstack::cinder::rabbitmq' include 'packstack::cinder' diff --git a/playbooks/packstack-centos9-pre.yaml b/playbooks/packstack-centos9-pre.yaml new file mode 100644 index 000000000..c692ef087 --- /dev/null +++ b/playbooks/packstack-centos9-pre.yaml @@ -0,0 +1,27 @@ +- hosts: all + name: packstack-centos9-pre + tasks: + - name: Ensure legacy workspace directory + file: + path: '{{ ansible_user_dir }}/workspace' + state: directory + + - shell: + cmd: | + cp -pr {{ ansible_user_dir }}/src/opendev.org/x/packstack {{ ansible_user_dir }}/workspace + + - shell: + cmd: | + set -e + set -x + rm -rf /etc/yum.repos.d/delorean* + # Remove epel repos + rm -rf /etc/yum.repos.d/epel* + dnf clean all + sudo sed -i '/^exclude.*/d' /etc/dnf/dnf.conf + dnf -y install libxml2-devel libxslt-devel ruby-devel zlib-devel + dnf -y install gcc gettext diffstat doxygen patch patchutils subversion systemtap git python3-setuptools wget redhat-lsb-core python3-libselinux virt-what yum + executable: /bin/bash + chdir: '{{ ansible_user_dir }}/workspace' + become: true + environment: '{{ zuul }}' diff --git a/playbooks/packstack-post-compute.yaml b/playbooks/packstack-post-compute.yaml index 6f1e46ec0..a52c33371 100644 --- a/playbooks/packstack-post-compute.yaml +++ b/playbooks/packstack-post-compute.yaml @@ -13,7 +13,7 @@ - shell: cmd: | - source /home/zuul/src/opendev.org/x/packstack/tools/copy-logs.sh + source {{ ansible_user_dir }}/src/opendev.org/x/packstack/tools/copy-logs.sh recover_default_logs mv /tmp/logs/* /tmp/compute mv /tmp/compute /tmp/logs diff --git a/run_tests.sh b/run_tests.sh index ff7672acf..634bdc0dc 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -163,7 +163,7 @@ $SUDO $PKG_MGR -y install puppet \ openstack-selinux \ policycoreutils \ rubygems \ - wget \ + curl \ gettext \ diffstat \ doxygen \ @@ -210,14 +210,14 @@ if [ -f ~/cache/files/cirros-$CIRROS_VERSION-$CIRROS_ARCH-uec.tar.gz ]; then tar -xzvf ~/cache/files/cirros-$CIRROS_VERSION-$CIRROS_ARCH-uec.tar.gz -C /tmp/cirros/ else echo "No pre-cached uec archive found, downloading..." - wget --tries=10 https://download.cirros-cloud.net/$CIRROS_VERSION/cirros-$CIRROS_VERSION-$CIRROS_ARCH-uec.tar.gz -P /tmp/cirros/ + curl -Lo /tmp/cirros/cirros-$CIRROS_VERSION-$CIRROS_ARCH-uec.tar.gz --retry 10 https://download.cirros-cloud.net/$CIRROS_VERSION/cirros-$CIRROS_VERSION-$CIRROS_ARCH-uec.tar.gz tar -xzvf /tmp/cirros/cirros-$CIRROS_VERSION-$CIRROS_ARCH-uec.tar.gz -C /tmp/cirros/ fi if [ -f ~/cache/files/cirros-$CIRROS_VERSION-$CIRROS_ARCH-disk.img ]; then cp -p ~/cache/files/cirros-$CIRROS_VERSION-$CIRROS_ARCH-disk.img /tmp/cirros/ else echo "No pre-cached disk image found, downloading..." - wget --tries=10 https://download.cirros-cloud.net/$CIRROS_VERSION/cirros-$CIRROS_VERSION-$CIRROS_ARCH-disk.img -P /tmp/cirros/ + curl -Lo /tmp/cirros/cirros-$CIRROS_VERSION-$CIRROS_ARCH-disk.img --retry 10 https://download.cirros-cloud.net/$CIRROS_VERSION/cirros-$CIRROS_VERSION-$CIRROS_ARCH-disk.img fi echo "Using pre-cached images:" find /tmp/cirros -type f -printf "%m %n %u %g %s %t" -exec md5sum \{\} \; @@ -275,8 +275,12 @@ if [ "${INSTALL_FROM_SOURCE}" = true ]; then fi export PUPPETFILE_DIR=/usr/share/openstack-puppet/modules export GEM_HOME=/tmp/packstackgems - $SUDO gem install gettext -v 3.2.9 --no-ri --no-rdoc - $SUDO gem install r10k -v 2.6.4 --no-ri --no-rdoc + if ([ "$OS_NAME" = "RedHat" ] || [ "$OS_NAME" = "CentOS" ]) && [ $OS_VERSION -gt 8 ]; then + $SUDO gem install r10k + else + $SUDO gem install gettext -v 3.2.9 --no-ri --no-rdoc + $SUDO gem install r10k -v 2.6.4 --no-ri --no-rdoc + fi # make sure there is no puppet module pre-installed $SUDO rm -rf "${PUPPETFILE_DIR:?}/"* install_modules