Skip to content

Commit e3e2b34

Browse files
committed
Merge pull request #38 from flyingelephantlab/master
Adding wait after mongodb restart
2 parents b22dcbd + df90644 commit e3e2b34

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tasks/auth_initialization.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
service: name={{ mongodb_daemon_name }} state=restarted
77
when: mongodb_manage_service
88

9+
- name: wait MongoDB port is listening
10+
wait_for: host="{{ mongodb_conf_bind_ip }}"port="{{ mongodb_conf_port }}" delay=5 state=started
11+
912
- name: get pid of mongodb for non daemon mode
1013
shell: "pidof mongod"
1114
register: pidof_mongod
@@ -64,6 +67,9 @@
6467
service: name={{ mongodb_daemon_name }} state=restarted
6568
when: mongodb_manage_service
6669

70+
- name: wait MongoDB port is listening
71+
wait_for: host="{{ mongodb_conf_bind_ip }}"port="{{ mongodb_conf_port }}" delay=5 state=started
72+
6773
- name: stop mongodb if was not started
6874
shell: "kill {{ pidof_mongod.stdout }}"
6975
when: mongodb_manage_service == false and pidof_mongod.rc == 0

0 commit comments

Comments
 (0)