You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
ansible-role-nginx/mongodb/roles/mongod/tasks/shards.yml

15 lines
519 B

---
#This Playbooks adds shards to the mongos servers once everythig is added
- name: Create the file to initialize the mongod Shard
template: src=shard_init.j2 dest=/tmp/shard_init_{{ inventory_hostname }}.js
delegate_to: '{{ item }}'
with_items: groups.mongos_servers
- name: Add the shard to the mongos
shell: /usr/bin/mongo localhost:{{ mongos_port }}/admin -u admin -p {{ mongo_admin_pass }} /tmp/shard_init_{{ inventory_hostname }}.js
delegate_to: '{{ item }}'
with_items: groups.mongos_servers