Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 22.04 LTS #2

Merged
merged 1 commit into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@
'server' => 'keyserver.ubuntu.com',
},
}
$repo24 = {
comment => 'ProxySQL 2.4.x APT repository',
location => "http://repo.proxysql.com/ProxySQL/proxysql-2.4.x/${facts['os']['distro']['codename']}/",
release => './',
repos => '',
key => {
'id' => '1448BF693CA600C799EB935804A562FB79953B49',
'server' => 'keyserver.ubuntu.com',
},
}
}
'RedHat': {
$package_provider = 'rpm'
Expand Down
6 changes: 6 additions & 0 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

if $proxysql::manage_repo and !$proxysql::package_source {
$repo = $proxysql::version ? {
/^2\.4\./ => $proxysql::params::repo24,
/^2\.3\./ => $proxysql::params::repo23,
/^2\.2\./ => $proxysql::params::repo22,
/^2\.1\./ => $proxysql::params::repo21,
Expand All @@ -26,6 +27,11 @@
}

# Purge old/unnecessary repos.
if ($proxysql::version !~ /^2\.4\./) {
yumrepo { $proxysql::params::repo24['name']:
ensure => absent,
}
}
if ($proxysql::version !~ /^2\.3\./) {
yumrepo { $proxysql::params::repo23['name']:
ensure => absent,
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'spec_helper_acceptance'

describe 'proxysql class' do
unless ['18.04', '20.04'].include?(fact('os.release.major')) ||
unless ['18.04', '20.04', '22.04'].include?(fact('os.release.major')) ||
(fact('os.name') == 'Debian' && fact('os.release.major') == '10') # There are no proxysql 1.4 packages for these OSes
context 'version 1.4' do
it 'works idempotently with no errors' do
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/proxysql_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
sys_user = 'proxysql'
sys_group = 'proxysql'

admin_socket = if ['18.04', '20.04'].include?(facts[:operatingsystemrelease])
admin_socket = if ['18.04', '20.04', '22.04'].include?(facts[:operatingsystemrelease])
'/var/lib/proxysql/proxysql_admin.sock'
else
'/tmp/proxysql_admin.sock'
Expand Down Expand Up @@ -102,7 +102,7 @@
end

unless (facts[:osfamily] == 'RedHat' && facts[:operatingsystemmajrelease] == '7') ||
(facts[:operatingsystem] == 'Ubuntu' && ['18.04', '20.04'].include?(facts[:operatingsystemmajrelease])) ||
(facts[:operatingsystem] == 'Ubuntu' && ['18.04', '20.04', '22.04'].include?(facts[:operatingsystemmajrelease])) ||
(facts[:operatingsystem] == 'Debian' && facts[:operatingsystemmajrelease] =~ %r{^(9|10)$})
it { is_expected.to contain_service('proxysql').with_hasstatus(true) }
it { is_expected.to contain_service('proxysql').with_hasrestart(true) }
Expand Down