Skip to content

Commit 390f926

Browse files
author
Sergei Antipov
committed
Added task for waiting mongodb server is running
1 parent 45da87d commit 390f926

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tasks/configure.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,14 @@
6666
- name: mongodb restart
6767
service: name={{ mongodb_daemon_name }} state=restarted
6868
when: config_result|changed and mongodb_manage_service
69+
70+
- name: Set fact about wait_for host address
71+
set_fact:
72+
wait_for_host: 127.0.0.1
73+
when: mongodb_conf_bind_ip == "0.0.0.0"
74+
75+
- name: Wait when mongodb is started
76+
wait_for:
77+
host: "{{ wait_for_host | default(mongodb_conf_bind_ip) }}"
78+
port: "{{ mongodb_conf_port }}"
79+
timeout: 120

0 commit comments

Comments
 (0)