From 3a2e9c0d3411884705f5bf237f06a1750c5ecaee Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Wed, 23 Nov 2016 12:50:38 -0800 Subject: [PATCH] Conditionally set mysql max connections Only install the max_connections config file for the mysql server if we are installing the mysql server. Change-Id: I0c9beb54d3e6982fc4c1b4de8ce1f81eb40c654d --- manifests/init.pp | 8 -------- manifests/mysql.pp | 9 +++++++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index d1e0f36..67e39ca 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -80,14 +80,6 @@ class nodepool ( } } - file { '/etc/mysql/conf.d/max_connections.cnf': - ensure => present, - content => "[server]\nmax_connections = 8192\n", - mode => '0444', - owner => 'root', - group => 'root', - } - user { 'nodepool': ensure => present, home => '/home/nodepool', diff --git a/manifests/mysql.pp b/manifests/mysql.pp index ce8bdd0..bf26d4c 100644 --- a/manifests/mysql.pp +++ b/manifests/mysql.pp @@ -47,4 +47,13 @@ class nodepool::mysql ( ], } + file { '/etc/mysql/conf.d/max_connections.cnf': + ensure => present, + content => "[server]\nmax_connections = 8192\n", + mode => '0444', + owner => 'root', + group => 'root', + require => Class['mysql::server'], + } + }