diff --git a/manifests/params.pp b/manifests/params.pp index 9dcf3481..cc1d73d6 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -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' diff --git a/manifests/repo.pp b/manifests/repo.pp index 8708964e..883c2ee1 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -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, @@ -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, diff --git a/spec/acceptance/class_spec.rb b/spec/acceptance/class_spec.rb index c578893a..9db9ed67 100644 --- a/spec/acceptance/class_spec.rb +++ b/spec/acceptance/class_spec.rb @@ -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 diff --git a/spec/classes/proxysql_spec.rb b/spec/classes/proxysql_spec.rb index 5cdd9ba4..b13f21fe 100644 --- a/spec/classes/proxysql_spec.rb +++ b/spec/classes/proxysql_spec.rb @@ -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' @@ -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) }