-
Notifications
You must be signed in to change notification settings - Fork 0
Mongo Auth The Hard Way
-
if you can, back up the database you want, eg,
mongodump
; that will give you everything you are able to read... -
copy out and SSL certs you want to save from prior installation if it is on the same IP. otherwise run the mongo.yml to gen a new TLS key.
-
install a fresh cp of mongodb by hand.
-
copy the SSL config from another env and edit by hand. Epsilon does not use SSL.
-
either create or copy the mongo auth key you will need this to create a root user.
-
run mongodb without any data.
-
run the mongo shell using the admin database:
mongo admin
-
create an admin user for the admin db:
db.createUser({user: "superuser", pwd: "foobarbaz", roles: [ "root" ] })
-
Log in using the account you just created.
-
Edit the appropriate db with the correct credentials from ansible.
-
Restore the saved data.
-
You may need to invalidate stale user tokens,
db.users.drop()