diff --git a/manifests/grant.pp b/manifests/grant.pp index ce7ce2f..db8c5ea 100644 --- a/manifests/grant.pp +++ b/manifests/grant.pp @@ -29,6 +29,8 @@ # Default: '' # $remote_password - Password to use when running the command on a remote server. # Default: '' +# $require_ssl - Define if SSL connection is required for the user. +# Default: false define mysql::grant ( $mysql_user, $mysql_password, @@ -41,7 +43,8 @@ $mysql_db_init_query_file = '', $remote_host = '', $remote_user = '', - $remote_password = '' + $remote_password = '', + $require_ssl = false, ) { require mysql diff --git a/templates/grant.erb b/templates/grant.erb index b8983e7..40fbeba 100644 --- a/templates/grant.erb +++ b/templates/grant.erb @@ -2,5 +2,5 @@ <% if @bool_mysql_create_db -%> CREATE DATABASE IF NOT EXISTS <%= @real_db %><%= @real_db_create_options %>; <% end -%> -GRANT <%= @mysql_privileges %> ON <%= @real_db %>.* TO '<%= @mysql_user %>'@'<%= @mysql_host %>' IDENTIFIED BY '<%= @mysql_password %>'; +GRANT <%= @mysql_privileges %> ON <%= @real_db %>.* TO '<%= @mysql_user %>'@'<%= @mysql_host %>' IDENTIFIED BY '<%= @mysql_password %>'<% if @require_ssl -%> require ssl<% end -%>; FLUSH PRIVILEGES ;