From aae26663a000289e1f8f944370eadcfc38919bed Mon Sep 17 00:00:00 2001 From: Denny Cave Date: Sat, 7 Oct 2023 09:54:09 -0500 Subject: [PATCH] Updating with new DB creation script --- manifest.yml | 12 +++++++++++- scripts/beforeInstall.js | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/manifest.yml b/manifest.yml index 92a2956..af6eb09 100755 --- a/manifest.yml +++ b/manifest.yml @@ -57,6 +57,7 @@ globals: LS_ADMIN_PASS: ${settings.LS_ADMIN_PASS:[fn.password(10)]} onInstall: + - setupDB - addLimits #- addMetadata - setDomain # why is this necessary? @@ -100,7 +101,16 @@ onInstall: email: /success/email/success.md?_r=${fn.random} actions: - + setupDB: + - cmd[sqldb]: |- + #jem passwd set -p wow #use if need to reset DB password + USER=${DB_USER} + PASSWORD=${DB_PASS} + MYSQL=`which mysql` + cmd="CREATE USER '$USER'@'localhost' IDENTIFIED BY '$PASSWORD'; CREATE USER '$USER'@'%' IDENTIFIED BY '$PASSWORD'; GRANT ALL PRIVILEGES ON *.* TO '$USER'@'localhost' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON *.* TO '$USER'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES;" + $MYSQL -uroot -p${nodes.sqldb.password} --execute="$cmd" + user: root + addLimits: #what does this do? - env.control.ApplyNodeGroupData [*]: data: diff --git a/scripts/beforeInstall.js b/scripts/beforeInstall.js index d3bdedf..8f268c5 100755 --- a/scripts/beforeInstall.js +++ b/scripts/beforeInstall.js @@ -30,7 +30,7 @@ resp.nodes.push({ diskLimit: "${settings.sqldb.diskspace:[quota.disk.limitation]}", count: db_count, nodeGroup: "sqldb", - restartDelay: 10, + //restartDelay: 10, skipNodeEmails: true, validation: { minCount: db_count,