Skip to content

Oplog user creation #128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ mongodb_users:
database: app_development
}
```
Example vars for oplog user:
```yaml
mongodb_oplog_users:
- {
user: oplog,
password: passw0rd
}
```
Required vars to change on production:
```yaml
mongodb_user_admin_password
Expand Down
22 changes: 22 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,28 @@
no_log: true
tags: [mongodb]

- name: create oplog user with replicaset
mongodb_user_fixed:
database: admin
user: "{{ item.user }}"
password: "{{ item.password }}"
update_password: "{{ mongodb_user_update_password }}"
roles:
- db: local
role: read
login_user: "{{ mongodb_user_admin_name }}"
login_password: "{{ mongodb_user_admin_password }}"
login_port: "{{ mongodb_login_port|default(27017) }}"
login_host: "{{ mongodb_login_host|default('localhost') }}"
with_items:
- "{{ mongodb_oplog_users | default([]) }}"
when: ( mongodb_replication_replset
and mongodb_replication_replset != ''
and mongodb_security_authorization == 'enabled'
and mongodb_master is defined and mongodb_master )
no_log: false
tags: [mongodb]

- name: Include MMS Agent configuration
include: mms-agent.yml
when: mongodb_mms_api_key != ""
Expand Down