Skip to content

Commit

Permalink
add config reload
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxFedotov committed Sep 3, 2018
1 parent 8ec6304 commit 1275536
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion manifests/reload_config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
#
class proxysql::reload_config {

$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=\"
Expand All @@ -14,7 +19,7 @@
LOAD MYSQL VARIABLES TO RUNTIME; \
SAVE MYSQL VARIABLES TO DISK; \"
",
subscribe => [ File['proxysql-config-file'], File['proxysql-proxy-config-file'] ],
subscribe => $subscribe,
require => [ Service[$::proxysql::service_name] , File['root-mycnf-file'] ],
refreshonly => true,
}
Expand Down

0 comments on commit 1275536

Please sign in to comment.