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

Support 2.5.x #200

Closed
wants to merge 2 commits into from
Closed
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
36 changes: 36 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,26 @@
'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',
},
}
$repo25 = {
comment => 'ProxySQL 2.5.x APT repository',
location => "http://repo.proxysql.com/ProxySQL/proxysql-2.5.x/${facts['os']['distro']['codename']}/",
release => './',
repos => '',
key => {
'id' => '1448BF693CA600C799EB935804A562FB79953B49',
'server' => 'keyserver.ubuntu.com',
},
}
}
'RedHat': {
$package_provider = 'rpm'
Expand Down Expand Up @@ -114,6 +134,22 @@
gpgcheck => true,
gpgkey => 'http://repo.proxysql.com/ProxySQL/repo_pub_key',
}
$repo24 = {
name => 'proxysql_2_4',
descr => 'ProxySQL 2.4.x YUM repository',
baseurl => "http://repo.proxysql.com/ProxySQL/proxysql-2.4.x/centos/${repo_os_major_version}",
enabled => true,
gpgcheck => true,
gpgkey => 'http://repo.proxysql.com/ProxySQL/repo_pub_key',
}
$repo25 = {
name => 'proxysql_2_5',
descr => 'ProxySQL 2.5.x YUM repository',
baseurl => "http://repo.proxysql.com/ProxySQL/proxysql-2.5.x/centos/${repo_os_major_version}",
enabled => true,
gpgcheck => true,
gpgkey => 'http://repo.proxysql.com/ProxySQL/repo_pub_key',
}
}
default: {
fail("osfamily ${facts['os']['family']} is not supported")
Expand Down
12 changes: 12 additions & 0 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

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

# Purge old/unnecessary repos.
if ($proxysql::version !~ /^2\.5\./) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to add some tests for some of these version to yumrepo inclusion?

Just as a comment a bit of refactor might be good to get rid fo those $repo24, $repo25, ... . At a quick glance their contents looks pretty much identical.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not using CentOS / YUM based linux distributions; so I just copy/pasted w/ those textual changes to mimic what I see elsewhere.

yumrepo { $proxysql::params::repo25['name']:
ensure => absent,
}
}
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