Skip to content

Commit 4d81a32

Browse files
committed
[SC] Apply SC customizations and upstream PR voxpupuli#247
SC-specific changes: - Use .my.proxysql.cnf instead of .my.cnf to avoid conflicts with MySQL on hosts running both MySQL and ProxySQL - Remove Sensitive[String] password types and .unwrap calls for compatibility with existing Hiera data and Puppet 7 setups Upstream PR voxpupuli#247 (not yet merged): - Add ProxySQL 3.0.x repository support for APT and YUM - Improve admin socket readiness check: use actual mysql SELECT 1 query instead of just testing socket file existence - Handle first-run (no .my.cnf) vs subsequent runs (with .my.cnf) Document all SC customizations in README.
1 parent d86b9bb commit 4d81a32

22 files changed

Lines changed: 162 additions & 47 deletions

README.markdown

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,29 @@
77
[![Puppet Forge - endorsement](https://img.shields.io/puppetforge/e/puppet/proxysql.svg)](https://forge.puppet.com/puppet/proxysql)
88
[![Puppet Forge - scores](https://img.shields.io/puppetforge/f/puppet/proxysql.svg)](https://forge.puppet.com/puppet/proxysql)
99

10+
## ScaleCommerce Fork
11+
12+
This is a fork of [voxpupuli/puppet-proxysql](https://github.com/voxpupuli/puppet-proxysql) with the following customizations:
13+
14+
### `.my.proxysql.cnf` instead of `.my.cnf`
15+
16+
The default path for the ProxySQL admin credentials file is `/root/.my.proxysql.cnf` instead of `/root/.my.cnf`.
17+
This avoids conflicts with MySQL's own `.my.cnf` on hosts where both MySQL and ProxySQL are running.
18+
19+
Affected files: `manifests/init.pp`, `lib/puppet/provider/proxysql.rb`, `lib/facter/proxysql_runtime.rb`, all `lib/puppet/type/*.rb` (autorequire), specs.
20+
21+
### Plain String passwords instead of Sensitive
22+
23+
Upstream uses `Sensitive[String]` for password parameters with `.unwrap` calls. This fork uses plain `String` types to maintain compatibility with existing Hiera data and Puppet 7 setups.
24+
25+
Affected files: `manifests/init.pp`, `templates/my.cnf.erb`.
26+
27+
### Upstream PR #247
28+
29+
ProxySQL 3.0.x repository support and improved admin socket readiness check from [voxpupuli/puppet-proxysql#247](https://github.com/voxpupuli/puppet-proxysql/pull/247).
30+
31+
---
32+
1033
## Table of Contents
1134

1235
1. [Overview](#overview)

REFERENCE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ Data type: `String`
340340
Path of the my.cnf file where the connections details for the admin interface is save. This is required for the providers to work.
341341
This will only be configured if `manage_mycnf_file` is set to `true`.
342342

343-
Default value: `'/root/.my.cnf'`
343+
Default value: `'/root/.my.proxysql.cnf'`
344344

345345
##### <a name="-proxysql--manage_mycnf_file"></a>`manage_mycnf_file`
346346

@@ -385,7 +385,7 @@ Default value: `true`
385385

386386
##### <a name="-proxysql--version"></a>`version`
387387

388-
Data type: `Pattern[/^[1|2]\.\d+\.\d+/]`
388+
Data type: `Pattern[/^[1|2|3]\.\d+\.\d+/]`
389389

390390
The version of proxysql being managed. This parameter affects the repository configured when `manage_repo == true` and how the service is managed.
391391
It does not affect the package version being installed. It is used as a hint to the puppet module on how to configure proxysql. To control the exact version
@@ -445,7 +445,7 @@ Default value:
445445
```puppet
446446
$version ? {
447447
/^1/ => 'root',
448-
/^2/ => 'proxysql'
448+
/^2|3/ => 'proxysql'
449449
```
450450

451451
##### <a name="-proxysql--sys_group"></a>`sys_group`

lib/facter/proxysql_runtime.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
end
1616

1717
begin
18-
client = Mysql2::Client.new(default_file: '/root/.my.cnf')
18+
client = Mysql2::Client.new(default_file: '/root/.my.proxysql.cnf')
1919
rescue Mysql2::Error::ConnectionError => e
2020
Facter.debug(e.inspect)
2121
end

lib/puppet/provider/proxysql.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Puppet::Provider::Proxysql < Puppet::Provider
1111

1212
# Optional defaults file
1313
def self.defaults_file
14-
"--defaults-extra-file=#{Facter.value(:root_home)}/.my.cnf" if File.file?("#{Facter.value(:root_home)}/.my.cnf")
14+
"--defaults-extra-file=#{Facter.value(:root_home)}/.my.proxysql.cnf" if File.file?("#{Facter.value(:root_home)}/.my.proxysql.cnf")
1515
end
1616

1717
def defaults_file

lib/puppet/type/proxy_cluster.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
ensurable
88

9-
autorequire(:file) { '/root/.my.cnf' }
9+
autorequire(:file) { '/root/.my.proxysql.cnf' }
1010
autorequire(:class) { 'mysql::client' }
1111
autorequire(:service) { 'proxysql' }
1212

lib/puppet/type/proxy_global_variable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Puppet::Type.newtype(:proxy_global_variable) do
55
@doc = 'Manage a ProxySQL global variable.'
66

7-
autorequire(:file) { '/root/.my.cnf' }
7+
autorequire(:file) { '/root/.my.proxysql.cnf' }
88
autorequire(:class) { 'mysql::client' }
99
autorequire(:service) { 'proxysql' }
1010

lib/puppet/type/proxy_mysql_galera_hostgroup.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Puppet::Type.newtype(:proxy_mysql_galera_hostgroup) do
66
@doc = 'Manage a ProxySQL mysql_galera_hostgroup.'
77

8-
autorequire(:file) { '/root/.my.cnf' }
8+
autorequire(:file) { '/root/.my.proxysql.cnf' }
99
autorequire(:class) { 'mysql::client' }
1010
autorequire(:service) { 'proxysql' }
1111

lib/puppet/type/proxy_mysql_group_replication_hostgroup.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
ensurable
88

9-
autorequire(:file) { '/root/.my.cnf' }
9+
autorequire(:file) { '/root/.my.proxysql.cnf' }
1010
autorequire(:class) { 'mysql::client' }
1111
autorequire(:service) { 'proxysql' }
1212

lib/puppet/type/proxy_mysql_query_rule.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
ensurable
77

8-
autorequire(:file) { '/root/.my.cnf' }
8+
autorequire(:file) { '/root/.my.proxysql.cnf' }
99
autorequire(:class) { 'mysql::client' }
1010
autorequire(:service) { 'proxysql' }
1111

lib/puppet/type/proxy_mysql_replication_hostgroup.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
ensurable
88

9-
autorequire(:file) { '/root/.my.cnf' }
9+
autorequire(:file) { '/root/.my.proxysql.cnf' }
1010
autorequire(:class) { 'mysql::client' }
1111
autorequire(:service) { 'proxysql' }
1212

0 commit comments

Comments
 (0)