Add custom port in command to check if admin user exists

This commit is contained in:
valferon 2017-04-10 16:04:24 +10:00
parent 2dec49074d
commit dd7c3078f8
1 changed files with 2 additions and 1 deletions

View File

@ -25,7 +25,8 @@
- name: Check user admin is exists - name: Check user admin is exists
command: > command: >
mongo --quiet -u {{ mongodb_user_admin_name }} \ 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 register: mongodb_user_admin_check
changed_when: false changed_when: false
always_run: yes # side-effect free, so it can be run in check-mode as well always_run: yes # side-effect free, so it can be run in check-mode as well