-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
add ability to split config into 2 files #60
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b31cf96
add ability to split config into 2 files
MaxFedotov 51ef5f7
add config reload
MaxFedotov 3d7d6a0
add config reload
MaxFedotov fe84efd
apply review notes. Change $:: to $. Use facts[]. Change erb template…
MaxFedotov 0c9e8ab
change :: to :. Use Stdlib::Absolutepath for params
MaxFedotov 0367744
add puppetlabs stdlib to dependencies
MaxFedotov ed2a8e5
Remove references to stdlib
d2594b3
move user/group management to prerequisites to prevent dependency cycles
mcrauwel 0b75147
checksums were changed while fixing sysown/proxysql#1679
mcrauwel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ | |
} | ||
} | ||
|
||
|
||
file { 'proxysql-datadir': | ||
ensure => directory, | ||
path => $proxysql::datadir, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Class: proxysql::prerequisites | ||
# =========================== | ||
# | ||
# Manage the prerequisites where the ProxySQL package might be | ||
# | ||
class proxysql::prerequisites inherits proxysql { | ||
if $proxysql::sys_owner != 'root' { # let's assume that 'root' will exist and not touch that... | ||
group { $proxysql::sys_group: | ||
ensure => 'present', | ||
} | ||
|
||
user { $proxysql::sys_owner: | ||
ensure => 'present', | ||
groups => $proxysql::sys_group, | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# == Class proxysql::reload_config | ||
# | ||
# This class is called from proxysql to update config if it changed. | ||
# | ||
class proxysql::reload_config { | ||
MaxFedotov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
$subscribe = $proxysql::split_config ? { | ||
true => [ File['proxysql-config-file'], File['proxysql-proxy-config-file'] ], | ||
false => File['proxysql-config-file'], | ||
} | ||
|
||
$mycnf_file_name = $proxysql::mycnf_file_name | ||
exec {'reload-config': | ||
command => "/usr/bin/mysql --defaults-extra-file=${mycnf_file_name} --execute=\" | ||
LOAD ADMIN VARIABLES FROM CONFIG; \ | ||
LOAD ADMIN VARIABLES TO RUNTIME; \ | ||
SAVE ADMIN VARIABLES TO DISK; \ | ||
LOAD MYSQL VARIABLES FROM CONFIG; \ | ||
LOAD MYSQL VARIABLES TO RUNTIME; \ | ||
SAVE MYSQL VARIABLES TO DISK; \" | ||
", | ||
subscribe => $subscribe, | ||
require => [ Service[$proxysql::service_name] , File['root-mycnf-file'] ], | ||
refreshonly => true, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<%- | Hash $config_settings | -%> | ||
<% $config_settings.each |$key, $value| { -%> | ||
<% if $key == "mysql_servers" { -%> | ||
<%= $key %> = (<% if $value != {} { -%><%= $value %><% } -%>) | ||
<% } -%> | ||
<% if $key == "mysql_users" { -%> | ||
<%= $key %> = (<% if $value != {} { -%><%= $value %><% } -%>) | ||
<% } -%> | ||
<% if $key == "mysql_query_rules" { -%> | ||
<%= $key %> = (<% if $value != {} { -%><%= $value %><% } -%>) | ||
<% } -%> | ||
<% if $key == "scheduler" { -%> | ||
<%= $key %> = (<% if $value != {} { -%><%= $value %><% } -%>) | ||
<% } -%> | ||
<% if $key == "mysql_replication_hostgroups" { -%> | ||
<%= $key %> = (<% if $value != {} { -%><%= $value %><% } -%>) | ||
<% } -%> | ||
<% } -%> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please use
String[1]
? Otherwise empty string is allowed as well.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh this is a path. Please use Stdlib::Absolutepath here.