diff --git a/ansible/roles/mongodb/tasks/bootstrap_cluster.yml b/ansible/roles/mongodb/tasks/bootstrap_cluster.yml
index 487edfc5227969cdfb87befad2e6cba83422d61a..c8633d4a25d2496b6867fa1ab3e249792d20f09b 100644
--- a/ansible/roles/mongodb/tasks/bootstrap_cluster.yml
+++ b/ansible/roles/mongodb/tasks/bootstrap_cluster.yml
@@ -5,7 +5,7 @@
 
 - name: Bootstrapping the mongodb replication set
   become: true
-  command: "docker exec -t mongodb mongo {{ api_interface_address }} --quiet --eval '{{ lookup('file','/tmp/mongodb_bootstrap_replication_set.js') }}'"
+  command: "docker exec -t mongodb mongo --host {{ api_interface_address }} --port {{ mongodb_port }} --quiet --eval '{{ lookup('file','/tmp/mongodb_bootstrap_replication_set.js') }}'"
   register: bootstrap_mongodb_cluster
   failed_when: (bootstrap_mongodb_cluster.stdout|from_json).ok != 1
   delegate_to: "{{ groups['mongodb'][0] }}"