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 Ubuntu 18.04 with proxysql 2.0 #102

Merged
merged 4 commits into from
May 16, 2019
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
1 change: 1 addition & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
docker_sets:
- set: ubuntu1404-64
- set: ubuntu1604-64
- set: ubuntu1804-64
- set: centos6-64
- set: centos7-64
- set: debian8-64
Expand Down
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ matrix:
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=ubuntu1604-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1804-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=ubuntu1804-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos6-64 BEAKER_HYPERVISOR=docker CHECK=beaker
Expand Down
4 changes: 2 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
# Defaults to the official upstream repo for your OS. See http://repo.proxysql.com for more info.
#
# * `repo_version`
# Specifies the repo version of ProxySQL to be configured. Defaults to '1.4.x'.
# Specifies the repo version of ProxySQL to be configured. Defaults to '1.4.x' ('2.0.x' for Ubuntu 18.04).
#
# * `package_source`
# location ot the proxysql package for the `package_provider`.
Expand Down Expand Up @@ -189,7 +189,7 @@

Boolean $manage_repo = true,
Hash $repo = $proxysql::params::repo14,
Enum['2.0.x','1.4.x'] $repo_version = '1.4.x',
Enum['2.0.x','1.4.x'] $repo_version = $proxysql::params::repo_version,

String $package_source = $proxysql::params::package_source,
String $package_checksum_value = $proxysql::params::package_checksum_value,
Expand Down
27 changes: 18 additions & 9 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,13 @@

$listen_ip = '0.0.0.0'
$listen_port = 6033
$listen_socket = '/tmp/proxysql.sock'

$admin_username = 'admin'
$admin_password = Sensitive('admin')
$admin_listen_ip = '127.0.0.1'
$admin_listen_port = 6032

$admin_listen_socket = '/tmp/proxysql_admin.sock'
$sys_owner = 'root'
$sys_group = 'root'
$datadir = '/var/lib/proxysql'

case $facts['os']['family'] {
'Debian': {
Expand Down Expand Up @@ -66,10 +63,17 @@
$package_dependencies = []
}
'18.04': {
# no upstream bionic builds are provided yet.
$package_source = undef
$package_checksum_value = undef
$package_checksum_type = undef
$_repo_version = '2.0.x'
$_sys_owner = 'proxysql'
$_sys_group = 'proxysql'

# The 2.0.x systemd service file in ubuntu 18.04 has `ReadWritePaths=/var/lib/proxysql /var/run/proxysql`.
# This limits where we can write sockets.
$_listen_socket = "${datadir}/proxysql.sock"
$_admin_listen_socket = "${datadir}/proxysql_admin.sock"
$package_source = 'https://github.com/sysown/proxysql/releases/download/v2.0.4/proxysql_2.0.4-ubuntu18_amd64.deb'
$package_checksum_value = '397e7244663d8e15134d788e918d9d75c0802b5a'
$package_checksum_type = 'sha1'
$package_dependencies = []
}
default: {
Expand Down Expand Up @@ -129,10 +133,15 @@
}
}

$sys_owner = pick(getvar('_sys_owner'),'root')
$sys_group = pick(getvar('_sys_group'),'root')
$repo_version = pick(getvar('_repo_version'),'1.4.x')
$listen_socket = pick(getvar('_listen_socket'),'/tmp/proxysql.sock')
$admin_listen_socket = pick(getvar('_admin_listen_socket'),'/tmp/proxysql_admin.sock')

$monitor_username = 'monitor'
$monitor_password = Sensitive('monitor')

$datadir = '/var/lib/proxysql'

$split_config = false
$config_file = '/etc/proxysql.cnf'
Expand Down
3 changes: 2 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"14.04",
"16.04"
"16.04",
"18.04"
]
}
],
Expand Down
15 changes: 11 additions & 4 deletions spec/classes/proxysql_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,15 @@
install_options: [])
end

let(:sys_user) { 'root' }
let(:sys_group) { 'root' }
if facts[:operatingsystemrelease] == '18.04'
sys_user = 'proxysql'
sys_group = 'proxysql'
admin_socket = '/var/lib/proxysql/proxysql_admin.sock'
else
sys_user = 'root'
sys_group = 'root'
admin_socket = '/tmp/proxysql_admin.sock'
end

it do
is_expected.to contain_file('proxysql-config-file').with(ensure: 'file',
Expand Down Expand Up @@ -70,8 +77,8 @@

it do
is_expected.to contain_exec('wait_for_admin_socket_to_open').with(
command: 'test -S /tmp/proxysql_admin.sock',
unless: 'test -S /tmp/proxysql_admin.sock',
command: "test -S #{admin_socket}",
unless: "test -S #{admin_socket}",
tries: 3,
try_sleep: 10,
require: 'Service[proxysql]',
Expand Down