Merged backup user creating
This commit is contained in:
commit
86d4cb209a
11
README.md
11
README.md
|
@ -91,6 +91,16 @@ mongodb_mms_group_id: ""
|
|||
mongodb_mms_api_key: ""
|
||||
mongodb_mms_base_url: https://mms.mongodb.com
|
||||
|
||||
# Log rotation
|
||||
mongodb_logrotate: true # Rotate mongodb logs.
|
||||
mongodb_logrotate_options:
|
||||
- compress
|
||||
- copytruncate
|
||||
- daily
|
||||
- dateext
|
||||
- rotate 7
|
||||
- size 10M
|
||||
|
||||
# password for inter-process authentication
|
||||
# please regenerate this file on production environment with command 'openssl rand -base64 741'
|
||||
mongodb_keyfile_content: |
|
||||
|
@ -138,6 +148,7 @@ Required vars to change on production:
|
|||
```yaml
|
||||
mongodb_user_admin_password
|
||||
mongodb_root_admin_password
|
||||
mongodb_root_backup_name
|
||||
|
||||
# if you use replication and authorization
|
||||
mongodb_security_keyfile
|
||||
|
|
|
@ -87,3 +87,6 @@ mongodb_user_admin_password: passw0rd
|
|||
|
||||
mongodb_root_admin_name: siteRootAdmin
|
||||
mongodb_root_admin_password: passw0rd
|
||||
|
||||
mongodb_root_backup_name: "backupuser"
|
||||
mongodb_root_backup_password: "passw0rd"
|
||||
|
|
|
@ -49,6 +49,21 @@
|
|||
roles: "root"
|
||||
}
|
||||
|
||||
- name: create backup user "backupuser"
|
||||
mongodb_user:
|
||||
database: admin
|
||||
name: "{{ item.name }}"
|
||||
password: "{{ item.password }}"
|
||||
update_password: "{{ mongodb_user_update_password }}"
|
||||
roles: "{{ item.roles }}"
|
||||
login_port: "{{ mongodb_net_port }}"
|
||||
with_items:
|
||||
- {
|
||||
name: "{{ mongodb_root_backup_name }}",
|
||||
password: "{{ mongodb_root_backup_password }}",
|
||||
roles: "backup,clusterMonitor"
|
||||
}
|
||||
|
||||
- name: Move back mongod.conf
|
||||
template: src=mongod.conf.j2 dest=/etc/mongod.conf owner=root group=root mode=0644
|
||||
|
||||
|
|
Loading…
Reference in New Issue