Skip to content

Instantly share code, notes, and snippets.

@freyes
Forked from msplival/juju2 dial mongo
Last active May 23, 2019 20:46
Show Gist options
  • Save freyes/cdc528e07e945e95f2a3c1c23e44965b to your computer and use it in GitHub Desktop.
Save freyes/cdc528e07e945e95f2a3c1c23e44965b to your computer and use it in GitHub Desktop.
dialmgo() {
agent=$(cd /var/lib/juju/agents; echo machine-*)
pw=$(sudo cat /var/lib/juju/agents/${agent}/agent.conf |grep statepassword |awk '{ print $2 }')
mongo --ssl --sslAllowInvalidCertificates -u ${agent} -p $pw localhost:37017/juju --authenticationDatabase admin
}
dialmgo() {
agent=$(cd /var/lib/juju/agents; echo machine-*)
pw=$(sudo cat /var/lib/juju/agents/${agent}/agent.conf |grep statepassword |awk '{ print $2 }')
/usr/lib/juju/mongo3.2/bin/mongo --ssl --sslAllowInvalidCertificates -u ${agent} -p $pw localhost:37017/juju --authenticationDatabase admin
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment