From 3573dceb0fc4c23a671cef106de01e7855d21019 Mon Sep 17 00:00:00 2001 From: Robin Douine Date: Sun, 16 Feb 2020 17:51:30 +0100 Subject: [PATCH 1/2] Add MySQL attributes Allows to configure the MySQL wait_timeout and max_connect_errors variables --- attributes/default.rb | 2 ++ recipes/default.rb | 6 ++++-- templates/default/librenms-mysqld.cnf.erb | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/attributes/default.rb b/attributes/default.rb index 8f18c3e..474721a 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -4,6 +4,8 @@ default['mariadb']['user_librenms']['password'] = 'default' default['mariadb']['bind_address'] = '127.0.0.1' default['mariadb']['max_connections'] = 302 +default['mariadb']['max_connect_errors'] = 1000 +default['mariadb']['wait_timeout'] = 60 default['librenms']['root_dir'] = '/var/opt' default['librenms']['path'] = ::File.join(node['librenms']['root_dir'], 'librenms') diff --git a/recipes/default.rb b/recipes/default.rb index 0ac7115..caa552e 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -74,8 +74,10 @@ group 'root' mode '0644' variables( - bind_address: node['mariadb']['bind_address'], - max_connections: node['mariadb']['max_connections'], + bind_address: node['mariadb']['bind_address'], + max_connections: node['mariadb']['max_connections'], + max_connect_errors: node['mariadb']['max_connect_errors'], + wait_timeout: node['mariadb']['wait_timeout'], ) notifies :restart, 'service[mysql]' end diff --git a/templates/default/librenms-mysqld.cnf.erb b/templates/default/librenms-mysqld.cnf.erb index dd0138c..b586471 100644 --- a/templates/default/librenms-mysqld.cnf.erb +++ b/templates/default/librenms-mysqld.cnf.erb @@ -5,3 +5,5 @@ lower_case_table_names=0 bind-address = <%= @bind_address %> innodb_flush_log_at_trx_commit = 0 max_connections=<%= @max_connections %> +max_connect_errors=<%= @max_connect_errors %> +wait_timeout=<%= @wait_timeout %> From 65cbd21658c1a8afb7107152249268075bf72ea6 Mon Sep 17 00:00:00 2001 From: Robin Douine Date: Sun, 16 Feb 2020 18:00:12 +0100 Subject: [PATCH 2/2] Release 0.2.26 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index de84a92..207923f 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ long_description 'This cookbook installs and configure LibreNMS along with the required components (Apache and MySQL). LibreNMS is an autodiscovering PHP/MySQL-based network monitoring system.' issues_url 'https://github.com/criteo-cookbooks/librenms/issues' source_url 'https://github.com/criteo-cookbooks/librenms' -version '0.2.25' +version '0.2.26' supports 'centos7' supports 'centos' depends 'apache2'