From eb761796b2fb317e4696677b30d4975f8b87e5c7 Mon Sep 17 00:00:00 2001 From: Tobias Brox Date: Fri, 13 Nov 2015 22:23:02 +0100 Subject: [PATCH] support for socket location in .my.cnf --- manifests/init.pp | 5 +++++ manifests/params.pp | 1 + templates/root.my.cnf.backup.erb | 1 + templates/root.my.cnf.erb | 1 + 4 files changed, 8 insertions(+) diff --git a/manifests/init.pp b/manifests/init.pp index 8551f65..fda04fa 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -188,6 +188,10 @@ # [*pid_file*] # Path of pid file. Used by monitor # +# [*socket*] +# Path to the mysql socket file. If set, will appear in .my.cnf +# Remember to duplicate in the server configuration. +# # [*data_dir*] # Path of application data directory. Used by puppi # @@ -261,6 +265,7 @@ $config_file_group = params_lookup( 'config_file_group' ), $config_file_init = params_lookup( 'config_file_init' ), $pid_file = params_lookup( 'pid_file' ), + $socket = params_lookup( 'socket' ), $data_dir = params_lookup( 'data_dir' ), $log_dir = params_lookup( 'log_dir' ), $log_file = params_lookup( 'log_file' ), diff --git a/manifests/params.pp b/manifests/params.pp index 1dc911e..07e5401 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -113,6 +113,7 @@ $absent = false $disable = false $disableboot = false + $socket = '' ### General module variables that can have a site or per module default $monitor = false diff --git a/templates/root.my.cnf.backup.erb b/templates/root.my.cnf.backup.erb index 4e89135..e8f2521 100644 --- a/templates/root.my.cnf.backup.erb +++ b/templates/root.my.cnf.backup.erb @@ -2,3 +2,4 @@ [client] password= +<% if scope.lookupvar('mysql::socket') != '' %>socket=<%= scope.lookupvar('mysql::socket') %><% end %> diff --git a/templates/root.my.cnf.erb b/templates/root.my.cnf.erb index 1a712cf..9e70145 100644 --- a/templates/root.my.cnf.erb +++ b/templates/root.my.cnf.erb @@ -2,3 +2,4 @@ [client] password=<%= scope.lookupvar('mysql::real_root_password') %> +<% if scope.lookupvar('mysql::socket') != '' %>socket=<%= scope.lookupvar('mysql::socket') %><% end %>