Merge "Remove logic for old operating systems"

This commit is contained in:
Zuul 2024-07-23 08:32:19 +00:00 committed by Gerrit Code Review
commit 635f69d17f
4 changed files with 36 additions and 70 deletions

View File

@ -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

View File

@ -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'})

View File

@ -100,14 +100,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,

View File

@ -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) {