Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lustre IP route detection if there is no gateway #567

Merged
merged 4 commits into from
Feb 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions ansible/roles/lustre/tasks/configure.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
- name: Gather Lustre interface info
shell:
cmd: |
ip r get {{ _lustre_mgs_ip }}
ip --json r get {{ _lustre_mgs_ip }}
changed_when: false
register: _lustre_ip_r_mgs
vars:
_lustre_mgs_ip: "{{ lustre_mgs_nid | split('@') | first }}"

- name: Set facts for Lustre interface
set_fact:
_lustre_interface: "{{ _lustre_ip_r_mgs_info[4] }}"
_lustre_ip: "{{ _lustre_ip_r_mgs_info[6] }}"
_lustre_interface: "{{ _lustre_ip_r_mgs_info.dev }}"
_lustre_ip: "{{ _lustre_ip_r_mgs_info.prefsrc }}"
vars:
_lustre_ip_r_mgs_info: "{{ _lustre_ip_r_mgs.stdout_lines.0 | split }}"
# first line e.g. "10.167.128.1 via 10.179.0.2 dev eth0 src 10.179.3.149 uid 1000"
_lustre_ip_r_mgs_info: "{{ _lustre_ip_r_mgs.stdout | from_json | first }}"

- name: Write LNet configuration file
template:
Expand Down Expand Up @@ -44,4 +43,3 @@
state: "{{ (item.mount_state | default(lustre_mount_state)) }}"
opts: "{{ item.mount_options | default(lustre_mount_options) }}"
loop: "{{ lustre_mounts }}"

sjpb marked this conversation as resolved.
Show resolved Hide resolved
Loading