Skip to content

Commit

Permalink
Flag to refresh after configuration
Browse files Browse the repository at this point in the history
ProxySQL can reload from the configuration file at runtime without restarting process.
  • Loading branch information
hfm committed Sep 30, 2018
1 parent 97bcc2a commit 9c3127e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ Parameter | Data type | Description | Default
`service_ensure` | Stdlib::Ensure::Service | Whether proxysql should be running. | 'running'
`service_enable` | Boolean | Whether proxysql should be enabled to start at boot. | true
`configs` | Hash | The Configuration hashes for proxysql.cnf | See [data/common.yaml](./data/common.yaml)
`refresh_from_config` | Boolean | Whether proxysql should be restarted after updating configuration. | false

#### Private Classes

Expand Down
1 change: 1 addition & 0 deletions data/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ proxysql::configs:
mysql_query_rules: {}
scheduler: {}
mysql_replication_hostgroups: {}
proxysql::refresh_from_config: false
8 changes: 7 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
Stdlib::Ensure::Service $service_ensure,
Boolean $service_enable,
Hash $configs,
Boolean $refresh_from_config,
) {

include proxysql::repo
Expand All @@ -93,6 +94,11 @@
Class['::proxysql::repo']
-> Class['::proxysql::install']
-> Class['::proxysql::config']
~> Class['::proxysql::service']

if $refresh_from_config {
Class['::proxysql::config'] ~> Class['::proxysql::service']
} else {
Class['::proxysql::config'] -> Class['::proxysql::service']
}

}

0 comments on commit 9c3127e

Please sign in to comment.