deploy_inital_wdchat_mongo.yml
428 Bytes
---
- hosts: wdchat-dma
become: true
tasks:
- name: Create Database WDCHAT & WDAUTHEN & USER
expect:
command: /opt/stack/mongodb/mongodb/bin/mongo --host 127.0.0.1 --port 7018
responses:
'>': 'use admin'
'switched to db admin': 'db.auth("root", "password")'
'1': 'db.createUser({user: "test",pwd: "test",roles: [ { role: "userAdminAnyDatabase", db: "admin" }]})'