Updating with new DB creation script

main
Denny Cave 2023-10-07 09:54:09 -05:00
parent 0dd28bdb5b
commit aae26663a0
2 changed files with 12 additions and 2 deletions

View File

@ -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,6 +101,15 @@ 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 [*]:

View File

@ -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,