diff --git a/templates/grant.erb b/templates/grant.erb index 3db95a6..b4f12bb 100644 --- a/templates/grant.erb +++ b/templates/grant.erb @@ -1,8 +1,8 @@ # File managed by Puppet -<% if mysql_db != "*" then %> - CREATE DATABASE IF NOT EXISTS `<%= mysql_db %>` ; +<% if @mysql_db != "*" then %> + CREATE DATABASE IF NOT EXISTS `<%= @mysql_db %>` ; <% end %> -GRANT <%= mysql_privileges %> ON `<%= mysql_db %>`.* TO '<%= mysql_user %>'@'<%= mysql_host %>' IDENTIFIED BY '<%= mysql_password %>'; +GRANT <%= @mysql_privileges %> ON `<%= @mysql_db %>`.* TO '<%= @mysql_user %>'@'<%= @mysql_host %>' IDENTIFIED BY '<%= @mysql_password %>'; FLUSH PRIVILEGES ; diff --git a/templates/query.erb b/templates/query.erb index 3f641d1..13cd32e 100644 --- a/templates/query.erb +++ b/templates/query.erb @@ -1,7 +1,7 @@ # File managed by Puppet <% if @mysql_db -%> -USE <%= mysql_db -%> ; +USE <%= @mysql_db -%> ; <% end -%> -<%= mysql_query %> ; +<%= @mysql_query %> ; diff --git a/templates/spec.erb b/templates/spec.erb index 87b8c1e..0e81074 100644 --- a/templates/spec.erb +++ b/templates/spec.erb @@ -4,5 +4,5 @@ <%= scope.to_hash.reject { |k,v| !( k.is_a?(String) && v.is_a?(String) ) }.to_yaml %> # Custom Options -<%= options['opt_a'] %> -<%= options['opt_b'] %> +<%= @options['opt_a'] %> +<%= @options['opt_b'] %> diff --git a/templates/user.erb b/templates/user.erb index 2e09ad4..41b7119 100644 --- a/templates/user.erb +++ b/templates/user.erb @@ -1,12 +1,12 @@ # File managed by Puppet GRANT USAGE ON *.* - TO '<%= mysql_user %>'@'<%= mysql_host %>' + TO '<%= @mysql_user %>'@'<%= @mysql_host %>' IDENTIFIED BY - <% if has_variable?('mysql_password_hash') && mysql_password_hash then %> - PASSWORD '<%= mysql_password_hash %>' + <% if has_variable?('mysql_password_hash') && @mysql_password_hash then %> + PASSWORD '<%= @mysql_password_hash %>' <% else %> - '<%= mysql_password %>'; + '<%= @mysql_password %>'; <% end %> ; FLUSH PRIVILEGES;