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 Facter.add(:mariadb_provides_galera) do
setcode do setcode do
if Facter.value(:operatingsystem) == 'Fedora' and Facter.value(:operatingsystemmajrelease).to_i > 22 command = 'dnf repoquery --whatprovides mariadb-server-galera'
command = 'dnf repoquery --whatprovides mariadb-server-galera'
else
command = 'repoquery --whatprovides mariadb-server-galera'
end
output = Facter::Util::Resolution.exec(command) output = Facter::Util::Resolution.exec(command)
(output =~ /mariadb-server-galera.*/) != nil (output =~ /mariadb-server-galera.*/) != nil
end end

View File

@ -14,56 +14,38 @@ class packstack::cinder::backend::lvm ()
volume_name => $cinder_volume_name, volume_name => $cinder_volume_name,
} }
# Add loop device on boot file { 'openstack-losetup':
$el_releases = ['RedHat', 'CentOS', 'Scientific'] path => '/usr/lib/systemd/system/openstack-losetup.service',
if $::operatingsystem in $el_releases and (versioncmp($::operatingsystemmajrelease, '7') < 0) { 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': [Service]
path => '/etc/rc.d/rc.local', Type=oneshot
match => "^.*/var/lib/cinder/${cinder_volume_name}.*$", 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}\'
line => "losetup -f /var/lib/cinder/${cinder_volume_name} && service openstack-cinder-volume restart", 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': [Install]
mode => '0755', 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': service { 'openstack-losetup':
path => '/usr/lib/systemd/system/openstack-losetup.service', ensure => running,
before => Service['openstack-losetup'], enable => true,
notify => Exec['reload systemd files for cinder-volume'], require => Class['cinder::setup_test_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'],
}
}
} }
else { else {
ensure_packages(['lvm2'], {'ensure' => 'present'}) ensure_packages(['lvm2'], {'ensure' => 'present'})

View File

@ -100,14 +100,10 @@ class packstack::provision::tempest ()
$neutron_api_extensions = undef $neutron_api_extensions = undef
} }
if versioncmp($::operatingsystemmajrelease, '9') >= 0 { # NOTE(tkajinam): The latest openssl in c9s repo doesn't accept SHA1 by
# NOTE(tkajinam): The latest openssl in c9s repo doesn't accept SHA1 by # default, which is causing ssh with rsa keys to fail.
# default, which is causing ssh with rsa keys to fail. # See bug 1962507 for details.
# See bug 1962507 for details. $ssh_key_type = 'ecdsa'
$ssh_key_type = 'ecdsa'
} else {
$ssh_key_type = 'rsa'
}
class { 'tempest': class { 'tempest':
admin_domain_name => $admin_domain_name, admin_domain_name => $admin_domain_name,

View File

@ -7,17 +7,9 @@ class packstack::swift::ringbuilder ()
require => Class['swift'], 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
# sets up an rsync db that can be used to sync the ring DB class { 'swift::ringserver':
class { 'swift::ringserver': local_net_ip => lookup('CONFIG_STORAGE_HOST_URL'),
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'),
}
} }
if str2bool($::selinux) { if str2bool($::selinux) {