diff --git a/README.md b/README.md index 686a6a8..1779d86 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ mongodb_package: mongodb-org mongodb_force_wait_for_port: false # When not forced, the role will wait for mongod port to become available only with systemd mongodb_pymongo_from_pip: false # Install latest PyMongo via PIP or package manager +mongodb_pymongo_pip_version: "2.9" mongodb_disable_thp: true mongodb_manage_service: true diff --git a/defaults/main.yml b/defaults/main.yml index f495981..fc8e734 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -83,3 +83,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: "o8vUd0ldMVuyLKxY9ZiU" diff --git a/tasks/auth_initialization.yml b/tasks/auth_initialization.yml index ea6454a..aba5d40 100644 --- a/tasks/auth_initialization.yml +++ b/tasks/auth_initialization.yml @@ -44,14 +44,27 @@ roles: "root" } +- name: create backup user "backupuser" + mongodb_user: + database: admin + name: "{{ item.name }}" + password: "{{ item.password }}" + roles: "{{ item.roles }}" + login_port: "{{ mongodb_conf_port }}" + when: mongodb_conf_auth + with_items: + - { + name: "{{ mongodb_root_backup_name }}", + password: "{{ mongodb_root_backup_password }}", + roles: "backup,clusterMonitor" + } + - name: create normal users mongodb_user: database: "{{ item.database }}" name: "{{ item.name }}" password: "{{ item.password }}" roles: "{{ item.roles }}" - login_user: "{{ mongodb_user_admin_name }}" - login_password: "{{ mongodb_user_admin_password }}" login_port: "{{ mongodb_conf_port }}" with_items: - "{{ mongodb_users }}"