Last active
September 1, 2016 21:56
-
-
Save mjs/0d0b89356654de04adf4935860642c5f to your computer and use it in GitHub Desktop.
Helper to get a MongoDB shell on a Juju controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
model=${1:-controller} | |
machine=${2:-0} | |
read -d '' -r cmds <<'EOF' | |
password=`sudo grep oldpassword /var/lib/juju/agents/machine-*/agent.conf | cut -d' ' -f2` | |
/usr/lib/juju/mongo*/bin/mongo 127.0.0.1:37017/juju --authenticationDatabase admin --ssl --sslAllowInvalidCertificates --username "admin" --password "$password" | |
EOF | |
juju ssh -m $model $machine "$cmds" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment