Skip to content

Instantly share code, notes, and snippets.

@niedbalski
Created June 10, 2020 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niedbalski/713536a82e3e7dfa2560bbf56c710e99 to your computer and use it in GitHub Desktop.
Save niedbalski/713536a82e3e7dfa2560bbf56c710e99 to your computer and use it in GitHub Desktop.
update-password.sh
# curl https://gist.github.com/niedbalski/a6511e9bd3b6c674d9eb767211e5ccf3/raw/1909e266dcf5dc15ee43deef471f87b209d1ce7c/juju-pwhash
# p=$(openssl rand -hex 12) && printf "agent.conf=%s\nmongodb=%s\n" $p $(./juju-pwhash -p ${p})
agent.conf=2c0bdfcd9f61d5248005ff71
mongodb=9DYXMt1+hfklY2NiFcw2Y5dF
edit the agent.conf of the unit manually and change apipassword to ^^ agent.conf.
$ juju ssh -m controller 0
$ sudo su
# source <(curl -s https://gist.githubusercontent.com/msplival/b479edf76c4f9d1dda7a69e3addab6f5/raw/1d10eea9f0d1b459ee1fe4108cf9217eb3a46b5c/dialmgo-bionic)
# dialmgo
juju:PRIMARY> use juju
juju:PRIMARY> db.units.update({ $and : [{'name': "cinder-ceph/1"}, {'model-uuid': "b937f7f7-1f97-4d42-83e2-10580e15cb7f"}]}, {$set: { "passwordhash": "9DYXMt1+hfklY2NiFcw2Y5dF"}})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment