Milimetric has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/130499

Change subject: Fix provision from scratch
......................................................................

Fix provision from scratch

When provisioning a vm with an existing wikimetrics setup, everything
was fine, but errors are evident if you try to provision starting at
nothing.  This change fixes those errors.

Change-Id: I6c9346fdb02255cfdb8a5088d15ffcfe57b20881
---
M manifests/database.pp
1 file changed, 13 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet/wikimetrics 
refs/changes/99/130499/1

diff --git a/manifests/database.pp b/manifests/database.pp
index 878a016..8eff12a 100644
--- a/manifests/database.pp
+++ b/manifests/database.pp
@@ -45,7 +45,7 @@
     exec { 'wikimetrics_mysql_create_user':
         command => "/usr/bin/mysql ${username_option} ${password_option} -e \"
 CREATE USER '${db_user}'@'localhost' IDENTIFIED BY '${db_pass}';
-CREATE USER '${db_user}'@'127.0.0.1' IDENTIFIED BY '${db_pass}';",
+CREATE USER '${db_user}'@'127.0.0.1' IDENTIFIED BY '${db_pass}';\"",
         unless  => "/usr/bin/mysql ${username_option} ${password_option} -e \"
 SELECT user FROM mysql.user;\" | grep -q \"${db_user}\"",
         user    => 'root',
@@ -79,16 +79,17 @@
             Wikimetrics::Database::Create[$db_name_wikimetrics],
             Exec['wikimetrics_mysql_create_user']
         ],
-     }
+    }
 
-     # If we are running in debug mode, then
-     # go ahead and create the test databases
-     if $::wikimetrics::debug {
-         wikimetrics::database::create { $db_names_testing:
-             db_user      => $db_user,
-             db_pass      => $db_pass,
-             db_root_user => $db_root_user,
-             db_root_pass => $db_root_pass,
-         }
-     }
+    # If we are running in debug mode, then
+    # go ahead and create the test databases
+    if $::wikimetrics::debug {
+        wikimetrics::database::create { $db_names_testing:
+            db_user      => $db_user,
+            db_pass      => $db_pass,
+            db_root_user => $db_root_user,
+            db_root_pass => $db_root_pass,
+            before       => Exec['alembic_upgrade_head']
+        }
+    }
  }

-- 
To view, visit https://gerrit.wikimedia.org/r/130499
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6c9346fdb02255cfdb8a5088d15ffcfe57b20881
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet/wikimetrics
Gerrit-Branch: master
Gerrit-Owner: Milimetric <dandree...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to