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,