Permalink
Browse files

* username/password in attributes (most likely for later)

 * setup dev env with percona::dev
  • Loading branch information...
1 parent bfa9e37 commit b8a4d7786816e00a9f56754480d1bad06feb7bef @till committed Apr 24, 2012
Showing with 24 additions and 3 deletions.
  1. +5 −3 percona/attributes/default.rb
  2. +2 −0 percona/files/default/grant.sql
  3. +17 −0 percona/recipes/dev.rb
@@ -1,6 +1,8 @@
-default[:percona] = {}
-default[:percona][:version] = "5.5"
-default[:percona][:key] = "1C4CBDCDCD2EFD2A"
+default[:percona] = {}
+default[:percona][:version] = "5.5"
+default[:percona][:key] = "1C4CBDCDCD2EFD2A"
+default[:percona][:user] = "root"
+default[:percona][:password] = ""
# set if scalarium is not available
set_unless[:mysql] = {}
@@ -0,0 +1,2 @@
+GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
+FLUSH PRIVILEGES;
View
@@ -0,0 +1,17 @@
+# Grant root access from *!
+# Obviously not a good idea in production.
+
+cookbook_file "/tmp/grant.sql" do
+ source "grant.sql"
+ mode "0600"
+end
+
+mysql_command = "mysql -u #{node[:percona][:user]}"
+if not node[:percona][:password].empty?
+ mysql_command += " -p#{node[:percona][:password]}"
+end
+mysql_command += " < /tmp/grant.sql"
+
+execute "open mysql to the world!!!111one" do
+ command mysql_command
+end

0 comments on commit b8a4d77

Please sign in to comment.