From cf7ae3519f2bd5b1cfd14821158c99f6c2bcaeb8 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 13 May 2024 15:15:14 +0900 Subject: [PATCH] Remove logic for old operating systems CentOS <= 8 or Fedora < 22 are too old. Change-Id: I820f134688e345a85ebd09ad6adcea2f6c79da12 --- .../modules/packstack/lib/facter/mariadb.rb | 6 +- .../packstack/manifests/cinder/backend/lvm.pp | 74 +++++++------------ .../packstack/manifests/provision/tempest.pp | 12 +-- .../packstack/manifests/swift/ringbuilder.pp | 14 +--- 4 files changed, 36 insertions(+), 70 deletions(-) diff --git a/packstack/puppet/modules/packstack/lib/facter/mariadb.rb b/packstack/puppet/modules/packstack/lib/facter/mariadb.rb index 02877bb67..d2748c262 100644 --- a/packstack/puppet/modules/packstack/lib/facter/mariadb.rb +++ b/packstack/puppet/modules/packstack/lib/facter/mariadb.rb @@ -3,11 +3,7 @@ Facter.add(:mariadb_provides_galera) do setcode do - if Facter.value(:operatingsystem) == 'Fedora' and Facter.value(:operatingsystemmajrelease).to_i > 22 - command = 'dnf repoquery --whatprovides mariadb-server-galera' - else - command = 'repoquery --whatprovides mariadb-server-galera' - end + command = 'dnf repoquery --whatprovides mariadb-server-galera' output = Facter::Util::Resolution.exec(command) (output =~ /mariadb-server-galera.*/) != nil end diff --git a/packstack/puppet/modules/packstack/manifests/cinder/backend/lvm.pp b/packstack/puppet/modules/packstack/manifests/cinder/backend/lvm.pp index 95578aea7..3a5c166d1 100644 --- a/packstack/puppet/modules/packstack/manifests/cinder/backend/lvm.pp +++ b/packstack/puppet/modules/packstack/manifests/cinder/backend/lvm.pp @@ -14,56 +14,38 @@ class packstack::cinder::backend::lvm () volume_name => $cinder_volume_name, } - # Add loop device on boot - $el_releases = ['RedHat', 'CentOS', 'Scientific'] - if $::operatingsystem in $el_releases and (versioncmp($::operatingsystemmajrelease, '7') < 0) { + file { 'openstack-losetup': + path => '/usr/lib/systemd/system/openstack-losetup.service', + before => Service['openstack-losetup'], + notify => Exec['reload systemd files for cinder-volume'], + content => "[Unit] +Description=Setup cinder-volume loop device +DefaultDependencies=false +Before=openstack-cinder-volume.service +After=local-fs.target - file_line{ 'rc.local_losetup_cinder_volume': - path => '/etc/rc.d/rc.local', - match => "^.*/var/lib/cinder/${cinder_volume_name}.*$", - line => "losetup -f /var/lib/cinder/${cinder_volume_name} && service openstack-cinder-volume restart", - } +[Service] +Type=oneshot +ExecStart=/usr/bin/sh -c \'/usr/sbin/losetup -j /var/lib/cinder/${cinder_volume_name} | /usr/bin/grep /var/lib/cinder/${cinder_volume_name} || /usr/sbin/losetup -f /var/lib/cinder/${cinder_volume_name}\' +ExecStop=/usr/bin/sh -c \'/usr/sbin/losetup -j /var/lib/cinder/${cinder_volume_name} | /usr/bin/cut -d : -f 1 | /usr/bin/xargs /usr/sbin/losetup -d\' +TimeoutSec=60 +RemainAfterExit=yes - file { '/etc/rc.d/rc.local': - mode => '0755', - } +[Install] +RequiredBy=openstack-cinder-volume.service", + } - } else { + exec { 'reload systemd files for cinder-volume': + command => '/usr/bin/systemctl daemon-reload', + refreshonly => true, + before => Service['openstack-losetup'], + } - file { 'openstack-losetup': - path => '/usr/lib/systemd/system/openstack-losetup.service', - before => Service['openstack-losetup'], - notify => Exec['reload systemd files for cinder-volume'], - content => "[Unit] - Description=Setup cinder-volume loop device - DefaultDependencies=false - Before=openstack-cinder-volume.service - After=local-fs.target - - [Service] - Type=oneshot - ExecStart=/usr/bin/sh -c \'/usr/sbin/losetup -j /var/lib/cinder/${cinder_volume_name} | /usr/bin/grep /var/lib/cinder/${cinder_volume_name} || /usr/sbin/losetup -f /var/lib/cinder/${cinder_volume_name}\' - ExecStop=/usr/bin/sh -c \'/usr/sbin/losetup -j /var/lib/cinder/${cinder_volume_name} | /usr/bin/cut -d : -f 1 | /usr/bin/xargs /usr/sbin/losetup -d\' - TimeoutSec=60 - RemainAfterExit=yes - - [Install] - RequiredBy=openstack-cinder-volume.service", - } - - exec { 'reload systemd files for cinder-volume': - command => '/usr/bin/systemctl daemon-reload', - refreshonly => true, - before => Service['openstack-losetup'], - } - - service { 'openstack-losetup': - ensure => running, - enable => true, - require => Class['cinder::setup_test_volume'], - } - - } + service { 'openstack-losetup': + ensure => running, + enable => true, + require => Class['cinder::setup_test_volume'], + } } else { ensure_packages(['lvm2'], {'ensure' => 'present'}) diff --git a/packstack/puppet/modules/packstack/manifests/provision/tempest.pp b/packstack/puppet/modules/packstack/manifests/provision/tempest.pp index 1355e09db..4d2acab78 100644 --- a/packstack/puppet/modules/packstack/manifests/provision/tempest.pp +++ b/packstack/puppet/modules/packstack/manifests/provision/tempest.pp @@ -101,14 +101,10 @@ class packstack::provision::tempest () $neutron_api_extensions = undef } - if versioncmp($::operatingsystemmajrelease, '9') >= 0 { - # NOTE(tkajinam): The latest openssl in c9s repo doesn't accept SHA1 by - # default, which is causing ssh with rsa keys to fail. - # See bug 1962507 for details. - $ssh_key_type = 'ecdsa' - } else { - $ssh_key_type = 'rsa' - } + # NOTE(tkajinam): The latest openssl in c9s repo doesn't accept SHA1 by + # default, which is causing ssh with rsa keys to fail. + # See bug 1962507 for details. + $ssh_key_type = 'ecdsa' class { 'tempest': admin_domain_name => $admin_domain_name, diff --git a/packstack/puppet/modules/packstack/manifests/swift/ringbuilder.pp b/packstack/puppet/modules/packstack/manifests/swift/ringbuilder.pp index 1d6ba95fa..359fb2061 100644 --- a/packstack/puppet/modules/packstack/manifests/swift/ringbuilder.pp +++ b/packstack/puppet/modules/packstack/manifests/swift/ringbuilder.pp @@ -7,17 +7,9 @@ class packstack::swift::ringbuilder () require => Class['swift'], } - 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 => lookup('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 => lookup('CONFIG_STORAGE_HOST_URL'), - } + # sets up an rsync db that can be used to sync the ring DB + class { 'swift::ringserver': + local_net_ip => lookup('CONFIG_STORAGE_HOST_URL'), } if str2bool($::selinux) {