Ottomata has submitted this change and it was merged.
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, 15 insertions(+), 13 deletions(-)
Approvals:
Ottomata: Verified; Looks good to me, approved
diff --git a/manifests/database.pp b/manifests/database.pp
index 878a016..b4f2e86 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',
@@ -66,6 +66,19 @@
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']
+}
+}
+
# In wikimetrics.pp we are installing all deps wia pip
# should be safe to assume alembic is installed
# this would run only if alembic is not setup
@@ -79,16 +92,5 @@
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,
- }
- }
+}
}
--
To view, visit https://gerrit.wikimedia.org/r/130499
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I6c9346fdb02255cfdb8a5088d15ffcfe57b20881
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet/wikimetrics
Gerrit-Branch: master
Gerrit-Owner: Milimetric dandree...@wikimedia.org
Gerrit-Reviewer: Milimetric dandree...@wikimedia.org
Gerrit-Reviewer: Ottomata o...@wikimedia.org
___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits