Skip to content

Commit 28a8297

Browse files
committed
add lnet configuration
1 parent 9f04b48 commit 28a8297

File tree

4 files changed

+37
-2
lines changed

4 files changed

+37
-2
lines changed

ansible/filesystems.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@
3232
tasks:
3333
- include_role:
3434
name: lustre
35+
# NB install is ONLY run in builder
3536
tasks_from: configure.yml

ansible/roles/lustre/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@ Install and configure a Lustre client. This builds RPM packages from source.
55
**NB:** The `install.yml` playbook in this role should only be run during image build, with the default `update_enable=true`. This ensures that the latest kernel and matching
66
`kernel-devel` packages will be installed. This playbook is not idempotent.
77

8+
**NB:** Currently this only supports RockyLinux 9.
9+
810
## Role Variables
911

10-
- `lustre_version`: Optional str. Version of lustre to build, default '2.15.64'. TODO: EXPLAIN. See https://wiki.whamcloud.com/display/PUB/Lustre+Support+Matrix
12+
- `lustre_version`: Optional str. Version of lustre to build, default '2.15.5' which is the first version with EL9 support
1113
- `lustre_mounts`: Required list. Define Lustre filesystems and mountpoints as a list of dicts with possible keys:
1214
- `mgs_nid`: The NID for the MGS, e.g. `192.168.227.11@tcp1`
1315
- `fs_name`: The name of the filesystem to mount
1416
- `mount_point`: Path to mount filesystem at. Default is `/mnt/lustre/{{ lustre_fs_name}}`
1517
- `mount_state`: Mountpoint state, as for [ansible.posix.mount](https://docs.ansible.com/ansible/latest/collections/ansible/posix/mount_module.html#parameter-state). Default `mounted`.
1618
Any of these parameters may alternatively be specified as role variables prefixed `lustre_`. If both are given entries in `lustre_mounts` take priority.
17-
19+
- `lustre_subnet_cidr`: Required str. CIDR of subnet for interface to be used for Lustre.
1820
The following variables control the package build and and install and should not generally be required:
1921
- `lustre_build_packages`: Optional list. Prerequisite packages required to build Lustre. See `defaults/main.yml`.
2022
- `lustre_build_dir`: Optional str. Path to build lustre at, default `/tmp/lustre-release`.

ansible/roles/lustre/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
lustre_version: '2.15.5' # https://www.lustre.org/lustre-2-15-5-released/
22
lustre_mounts: []
3+
#lustre_subnet_cidr:
34
#lustre_mgs_nid:
45
#lustre_fs_name:
56
lustre_mount_point: "/mnt/lustre/{{ lustre_fs_name }}"

ansible/roles/lustre/tasks/configure.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
- name: Gather interface info
2+
shell:
3+
cmd: |
4+
ip -o -f inet addr show | awk '{print $2, $4}' | awk -F/ '{print $1}'
5+
changed_when: false
6+
register: _inet_interfaces
7+
8+
- name: Set fact for Lustre interface
9+
set_fact:
10+
_lustre_interface: "{{ item.0 }}"
11+
when: lustre_subnet_cidr | ansible.utils.network_in_usable(item.1)
12+
loop: "{{ _inet_interfaces.stdout_lines | map('split') }}"
13+
14+
- name: Ensure Lustre interface found
15+
assert:
16+
that: _lustre_interface is defined
17+
fail_msg: "No interface was found for lustre_subnet_cidr={{ lustre_subnet_cidr }}"
18+
19+
- name: Write LNet configuration file
20+
template:
21+
src: lnet.conf.j2
22+
dest: /etc/lnet.conf # exists from package install
23+
owner: root
24+
group: root
25+
mode: u=rw,go=r # from package install
26+
register: _lnet_conf
27+
28+
- name: Import LNet configuration
29+
command: lnetctl import /etc/lnet.conf
30+
when: _lnet_conf.changed
31+
132
- name: Ensure mount points exist
233
ansible.builtin.file:
334
path: "{{ item.mount_point | default(lustre_mount_point) }}/{{ item.fs_name | default(lustre_fs_name) }}"

0 commit comments

Comments
 (0)