File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -151,6 +151,14 @@ mongodb_users:
151
151
database: app_development
152
152
}
153
153
` ` `
154
+ Example vars for oplog user :
155
+ ` ` ` yaml
156
+ mongodb_oplog_users:
157
+ - {
158
+ user: oplog,
159
+ password: passw0rd
160
+ }
161
+ ` ` `
154
162
Required vars to change on production :
155
163
` ` ` yaml
156
164
mongodb_user_admin_password
Original file line number Diff line number Diff line change 88
88
no_log : true
89
89
tags : [mongodb]
90
90
91
+ - name : create oplog user with replicaset
92
+ mongodb_user_fixed :
93
+ database : admin
94
+ user : " {{ item.user }}"
95
+ password : " {{ item.password }}"
96
+ update_password : " {{ mongodb_user_update_password }}"
97
+ roles :
98
+ - db : local
99
+ role : read
100
+ login_user : " {{ mongodb_user_admin_name }}"
101
+ login_password : " {{ mongodb_user_admin_password }}"
102
+ login_port : " {{ mongodb_login_port|default(27017) }}"
103
+ login_host : " {{ mongodb_login_host|default('localhost') }}"
104
+ with_items :
105
+ - " {{ mongodb_oplog_users | default([]) }}"
106
+ when : ( mongodb_replication_replset
107
+ and mongodb_replication_replset != ''
108
+ and mongodb_security_authorization == 'enabled'
109
+ and mongodb_master is defined and mongodb_master )
110
+ no_log : false
111
+ tags : [mongodb]
112
+
91
113
- name : Include MMS Agent configuration
92
114
include : mms-agent.yml
93
115
when : mongodb_mms_api_key != ""
You can’t perform that action at this time.
0 commit comments