TASK [mongod : Create admin user]01:19
fatal: [noc]: FAILED! => {
"changed": true,
"cmd": [
"/usr/bin/mongo",
"admin",
"/etc/mongod/admininit.js"
],
"delta": "0:00:00.080756",
"end": "2021-07-26 19:34:39.119485",
"rc": 253,
"start": "2021-07-26 19:34:39.038729"
}
STDOUT:
MongoDB shell version v4.2.13
connecting to: mongodb://127.0.0.1:27017/admin?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("7bbcb559-f211-416c-b4e7-fbdaa69ea5f8") }
MongoDB server version: 4.2.13
2021-07-26T19:34:39.115+0300 E QUERY [js] uncaught exception: 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:1413:11
@/etc/mongod/admininit.js:4:1
2021-07-26T19:34:39.115+0300 F - [main] failed to load: /etc/mongod/admininit.js
2021-07-26T19:34:39.115+0300 E - [main] exiting with code -3
MSG:
non-zero return code