Skip to content

Commit

Permalink
Merge pull request #153 from Anirudhra10/errorlog_configuration
Browse files Browse the repository at this point in the history
Add ability to configure errorlog file path and mode
  • Loading branch information
bastelfreak authored Aug 30, 2020
2 parents a077809 + 4f12852 commit 1eafdfa
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
20 changes: 19 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@
# * `datadir_mode`
# The filesystem mode for the `datadir`. Defaults to '0600'
#
# * `errorlog_file`
# The File where ProxySQL will store its error logs. Defaults to '/var/lib/proxysql/proxysql.log'. Available from ProxySQL v2.0.0
#
# * `errorlog_file_mode`
# The filesystem mode for the `errorlog_file_mode`. Defaults to '0600'. Available from ProxySQL v2.0.0
#
# * `errorlog_file_owner`
# Owner of the `errorlog_file`. Defaults to 'proxysql'. Available from ProxySQL v2.0.0
#
# * `errorlog_file_group`
# Group of the `errorlog_file`. Defaults to 'proxysql'. Available from ProxySQL v2.0.0
#
# * `manage_selinux`
# Whether to create the required selinux rules for logrotate to work. Defaults to `true`, but is only applicable to systems where SELinux is active (`enforcing` or `permissive`).
# This parameter also requires the `puppet/selinux` module to be installed.
Expand Down Expand Up @@ -182,6 +194,11 @@
Boolean $manage_selinux = true,
Boolean $manage_mysql_client = true,

Optional[Stdlib::Unixpath] $errorlog_file = undef,
Stdlib::Filemode $errorlog_file_mode = '0600',
String $errorlog_file_owner = 'proxysql',
String $errorlog_file_group = 'proxysql',

String $listen_ip = $proxysql::params::listen_ip,
Integer $listen_port = $proxysql::params::listen_port,
String $listen_socket = $proxysql::params::listen_socket,
Expand Down Expand Up @@ -246,6 +263,7 @@
) inherits proxysql::params {
$default_settings = {
datadir => $datadir,
errorlog => $errorlog_file,
admin_variables => {
admin_credentials => "${admin_username}:${admin_password.unwrap}",
mysql_ifaces => "${admin_listen_ip}:${admin_listen_port};${admin_listen_socket}",
Expand All @@ -263,7 +281,7 @@
mysql_replication_hostgroups => {},
mysql_group_replication_hostgroups => {},
mysql_galera_hostgroups => {},
}
}.filter |$key, $val| { $val =~ NotUndef }

$cluster_settings = $cluster_name ? {
String => {
Expand Down
10 changes: 10 additions & 0 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@
mode => $proxysql::datadir_mode,
}

if $proxysql::errorlog_file {
file { $proxysql::errorlog_file:
ensure => file,
path => $proxysql::errorlog_file,
owner => $proxysql::errorlog_file_owner,
group => $proxysql::errorlog_file_group,
mode => $proxysql::errorlog_file_mode,
}
}

if $proxysql::manage_mysql_client {
class { 'mysql::client':
package_name => $proxysql::mysql_client_package_name,
Expand Down

0 comments on commit 1eafdfa

Please sign in to comment.