Skip to content

Commit cb74360

Browse files
authored
Merge pull request #77 from anatoly-chichikov/multiple-ip-binding-fix
Fixed issue with multi-port binding timeouts
2 parents 1ba531c + 4fcbaa0 commit cb74360

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

tasks/auth_initialization.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@
7474
service: name={{ mongodb_daemon_name }} state=restarted
7575
when: mongodb_manage_service
7676

77-
- name: wait MongoDB port is listening
78-
wait_for: host="{{ mongodb_net_bindip }}" port="{{ mongodb_net_port }}" delay=5 state=started
77+
- name: Wait MongoDB port is listening
78+
wait_for: host="{{ item }}" port="{{ mongodb_net_port }}" delay=5 state=started
79+
with_items: "{{ mongodb_net_bindip.split(',') | map('replace', '0.0.0.0', '127.0.0.1') | list }}"
7980

8081
- name: stop mongodb if was not started
8182
shell: "kill {{ pidof_mongod.stdout }}"

tasks/configure.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,9 @@
5050
- name: Ensure service is started
5151
service: name={{ mongodb_daemon_name }} state=started
5252

53-
- name: Set fact about wait_for host address
54-
set_fact:
55-
wait_for_host: 127.0.0.1
56-
when: mongodb_net_bindip == "0.0.0.0"
57-
5853
- name: Wait when mongodb is started
5954
wait_for:
60-
host: "{{ wait_for_host | default(mongodb_net_bindip) }}"
55+
host: "{{ item }}"
6156
port: "{{ mongodb_net_port }}"
6257
timeout: 120
58+
with_items: "{{ mongodb_net_bindip.split(',') | map('replace', '0.0.0.0', '127.0.0.1') | list }}"

0 commit comments

Comments
 (0)