mirror of
https://github.com/status-im/ansible-role-mongodb.git
synced 2025-01-22 03:00:53 +00:00
Adding wait after mongodb restart
This commit is contained in:
parent
b22dcbdd28
commit
df90644552
@ -6,6 +6,9 @@
|
|||||||
service: name={{ mongodb_daemon_name }} state=restarted
|
service: name={{ mongodb_daemon_name }} state=restarted
|
||||||
when: mongodb_manage_service
|
when: mongodb_manage_service
|
||||||
|
|
||||||
|
- name: wait MongoDB port is listening
|
||||||
|
wait_for: host="{{ mongodb_conf_bind_ip }}"port="{{ mongodb_conf_port }}" delay=5 state=started
|
||||||
|
|
||||||
- name: get pid of mongodb for non daemon mode
|
- name: get pid of mongodb for non daemon mode
|
||||||
shell: "pidof mongod"
|
shell: "pidof mongod"
|
||||||
register: pidof_mongod
|
register: pidof_mongod
|
||||||
@ -64,6 +67,9 @@
|
|||||||
service: name={{ mongodb_daemon_name }} state=restarted
|
service: name={{ mongodb_daemon_name }} state=restarted
|
||||||
when: mongodb_manage_service
|
when: mongodb_manage_service
|
||||||
|
|
||||||
|
- name: wait MongoDB port is listening
|
||||||
|
wait_for: host="{{ mongodb_conf_bind_ip }}"port="{{ mongodb_conf_port }}" delay=5 state=started
|
||||||
|
|
||||||
- name: stop mongodb if was not started
|
- name: stop mongodb if was not started
|
||||||
shell: "kill {{ pidof_mongod.stdout }}"
|
shell: "kill {{ pidof_mongod.stdout }}"
|
||||||
when: mongodb_manage_service == false and pidof_mongod.rc == 0
|
when: mongodb_manage_service == false and pidof_mongod.rc == 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user