mirror of
https://github.com/status-im/ansible-role-mongodb.git
synced 2025-01-22 03:00:53 +00:00
Fixed issue with multi-port binding timeouts
This commit is contained in:
parent
1ba531c5c6
commit
4fcbaa02ed
@ -74,8 +74,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
|
- name: Wait MongoDB port is listening
|
||||||
wait_for: host="{{ mongodb_net_bindip }}" port="{{ mongodb_net_port }}" delay=5 state=started
|
wait_for: host="{{ item }}" port="{{ mongodb_net_port }}" delay=5 state=started
|
||||||
|
with_items: "{{ mongodb_net_bindip.split(',') | map('replace', '0.0.0.0', '127.0.0.1') | list }}"
|
||||||
|
|
||||||
- name: stop mongodb if was not started
|
- name: stop mongodb if was not started
|
||||||
shell: "kill {{ pidof_mongod.stdout }}"
|
shell: "kill {{ pidof_mongod.stdout }}"
|
||||||
|
@ -50,13 +50,9 @@
|
|||||||
- name: Ensure service is started
|
- name: Ensure service is started
|
||||||
service: name={{ mongodb_daemon_name }} state=started
|
service: name={{ mongodb_daemon_name }} state=started
|
||||||
|
|
||||||
- name: Set fact about wait_for host address
|
|
||||||
set_fact:
|
|
||||||
wait_for_host: 127.0.0.1
|
|
||||||
when: mongodb_net_bindip == "0.0.0.0"
|
|
||||||
|
|
||||||
- name: Wait when mongodb is started
|
- name: Wait when mongodb is started
|
||||||
wait_for:
|
wait_for:
|
||||||
host: "{{ wait_for_host | default(mongodb_net_bindip) }}"
|
host: "{{ item }}"
|
||||||
port: "{{ mongodb_net_port }}"
|
port: "{{ mongodb_net_port }}"
|
||||||
timeout: 120
|
timeout: 120
|
||||||
|
with_items: "{{ mongodb_net_bindip.split(',') | map('replace', '0.0.0.0', '127.0.0.1') | list }}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user