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 @@ -156,6 +156,14 @@ mongodb_users:
156
156
database: app_development
157
157
}
158
158
` ` `
159
+ Example vars for oplog user :
160
+ ` ` ` yaml
161
+ mongodb_oplog_users:
162
+ - {
163
+ user: oplog,
164
+ password: passw0rd
165
+ }
166
+ ` ` `
159
167
Required vars to change on production :
160
168
` ` ` yaml
161
169
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