Hi Team
Below is problem description on which i need help.
I am adding single mongo db shards by running below shell command -- this is working fine to install on one server
- name: "Creating the database"
command: "sh /tmp/add_shard.sh {{item}} {{mongo_user}} {{mongo_password}}"
register: mongo_db_shard_add
ignore_errors: true
with_items: "{{P_NODE}}"
when: ansible_default_ipv4_address ==== "{{item}}"
here my Question :
Now i want to run add mutiple shards on multiple servers (example: add 3 shards on each servers). So how to change above code?
Basically , i want to run below command repeatedly in loop for "n' number of time where n=number of shards to be added.
Also i should pass 'n' as input while running playbook
command: "sh /tmp/add_shard.sh {{item}} {{mongo_user}} {{mongo_password}} {{n}}"
where "n" is number of shards to be created"
Thanks
Hareesh