Group Mongo bootstrap secrets under infrastructure ownership
This commit is contained in:
1 parent
9dbf0bd80c
commit
9d57a65010
7 files changed
+22
-13
No files matched your search
@@ -28,11 +28,11 @@ mounts() {
|
||||
fi
|
||||
}
|
||||
provision_mongo() {
|
||||
if [ "$(kv bootstrap/mongo)" = null ]; then
|
||||
if [ "$(kv infrastructure/mongo/bootstrap)" = null ]; then
|
||||
random > "$WORK/password"; random 384 > "$WORK/keyfile"; random > "$WORK/manager"
|
||||
jq -n --rawfile password "$WORK/password" --rawfile keyfile "$WORK/keyfile" --rawfile manager "$WORK/manager" '{password:($password|rtrimstr("\n")),keyfile:($keyfile|rtrimstr("\n")),manager_password:($manager|rtrimstr("\n"))}' | put bootstrap/mongo
|
||||
jq -n --rawfile password "$WORK/password" --rawfile keyfile "$WORK/keyfile" --rawfile manager "$WORK/manager" '{password:($password|rtrimstr("\n")),keyfile:($keyfile|rtrimstr("\n")),manager_password:($manager|rtrimstr("\n"))}' | put infrastructure/mongo/bootstrap
|
||||
fi
|
||||
kv bootstrap/mongo > "$WORK/mongo-secret"
|
||||
kv infrastructure/mongo/bootstrap > "$WORK/mongo-secret"
|
||||
jq -r '.password' "$WORK/mongo-secret" | write "$STATE/mongo/password"
|
||||
jq -r '.keyfile' "$WORK/mongo-secret" | write "$STATE/mongo/keyfile"
|
||||
compose up -d mongo
|
||||
|
||||
Reference in new issue
Block a user