TASK [mongod : Create admin user]01:18
fatal: [noc]: FAILED! => {
"changed": true,
"cmd": [
"/usr/bin/mongo",
"admin",
"/etc/mongod/admininit.js"
],
"delta": "0:00:00.076751",
"end": "2021-10-05 22:17:49.837705",
"rc": 253,
"start": "2021-10-05 22:17:49.760954"
}
STDOUT:
MongoDB shell version v4.0.27
connecting to: mongodb://127.0.0.1:27017/admin?gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("13d826d1-fa93-425d-be0b-e3964af61dc7") }
MongoDB server version: 4.0.27
2021-10-05T22:17:49.834+0300 E QUERY [js] Error: couldn't add user: command createUser requires authentication :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
DB.prototype.createUser@src/mongo/shell/db.js:1513:15
@/etc/mongod/admininit.js:4:1
failed to load: /etc/mongod/admininit.js
MSG:
non-zero return code