Skip to content

Commit

Permalink
fix: skip sharding on set default rw concern
Browse files Browse the repository at this point in the history
setDefaultRWConcern is not supported on shard nodes.
  • Loading branch information
heryheming authored Dec 30, 2024
1 parent d054d00 commit cd21551
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
- name: Set default read-write concern
ansible.builtin.command: "{{ 'mongosh' if mongodb_version.split('.')[0] | int >= 5 else 'mongo' }} --quiet -u {{ mongodb_root_admin_name }} -p {{ mongodb_root_admin_password }} --eval 'db.adminCommand({\"setDefaultRWConcern\": 1,\"defaultWriteConcern\": { \"w\": 1 }})'"
when: ( mongodb_replication_replset | length > 0
and mongodb_master is defined and mongodb_master )
and mongodb_master is defined and mongodb_master and mongodb_sharding_enabled is false)
no_log: false
tags: [mongodb]

Expand Down

0 comments on commit cd21551

Please sign in to comment.