From dd7c3078f83a0f56e7221b0e3715084deb88dceb Mon Sep 17 00:00:00 2001 From: valferon Date: Mon, 10 Apr 2017 16:04:24 +1000 Subject: [PATCH] Add custom port in command to check if admin user exists --- tasks/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index a7aa357a..6e569766 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -25,7 +25,8 @@ - name: Check user admin is exists command: > mongo --quiet -u {{ mongodb_user_admin_name }} \ - -p {{ mongodb_user_admin_password }} --eval 'db.version()' admin + -p {{ mongodb_user_admin_password }} --port {{ mongodb_net_port }} --eval 'db.version()' admin + register: mongodb_user_admin_check changed_when: false always_run: yes # side-effect free, so it can be run in check-mode as well