Skip to content

Commit 0a5d2b4

Browse files
committed
Fix lustre IP route detection if there is no gateway
This handles the following case ``` 172.26.0.251 dev ib0 src 172.26.0.196 uid 0 ``` in addition to: ``` 10.167.128.1 via 10.179.0.2 dev eth0 src 10.179.3.149 uid 1000 ```
1 parent 440d6f5 commit 0a5d2b4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ansible/roles/lustre/tasks/configure.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99

1010
- name: Set facts for Lustre interface
1111
set_fact:
12-
_lustre_interface: "{{ _lustre_ip_r_mgs_info[4] }}"
13-
_lustre_ip: "{{ _lustre_ip_r_mgs_info[6] }}"
12+
_lustre_interface: "{{ _lustre_ip_r_mgs_info[interface_index | int] }}"
13+
_lustre_ip: "{{ _lustre_ip_r_mgs_info[ip_index | int] }}"
1414
vars:
15+
interface_index: "{{ 4 if 'via' in _lustre_ip_r_mgs.stdout_lines.0 else 2 }}"
16+
ip_index: "{{ 6 if 'via' in _lustre_ip_r_mgs.stdout_lines.0 else 4 }}"
1517
_lustre_ip_r_mgs_info: "{{ _lustre_ip_r_mgs.stdout_lines.0 | split }}"
1618
# first line e.g. "10.167.128.1 via 10.179.0.2 dev eth0 src 10.179.3.149 uid 1000"
1719

0 commit comments

Comments
 (0)