Help recover a broken juju controller upgrade

By the way, the juju codebase does have a helper script:
https://github.com/juju/juju/blob/develop/scripts/generate-password/main.go

(it is go, so it needs to be compiled with ‘go build’ or ‘go install’)

but it lets you run something like:

$ ./generate-password dead-beef-12345 machine-0
oldpassword: m0zFH6iaofjnQcDoITEFClMp
db.machines.update({"_id": "dead-beef-12345:machine-0"}, {$set: {"passwordhash": "lCr7hf2n/TQAYCAIG221/cZ4"}})

The first line is the content to put in agent.conf, the second is the mongodb query to run to update the database with the right content.
You would need to get the model-uuid from something like agent.conf.

We do keep that in our source tree, and we do make sure it compiles, though I don’t think we have a CI test that it can replace passwords, we are using the underlying functions that the code base uses.

1 Like