Skip to content

Commit 6d5da54

Browse files
committed
simplify lustre mount logic
1 parent 28a8297 commit 6d5da54

File tree

2 files changed

+18
-19
lines changed

2 files changed

+18
-19
lines changed

ansible/roles/lustre/defaults/main.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
lustre_version: '2.15.5' # https://www.lustre.org/lustre-2-15-5-released/
2-
lustre_mounts: []
32
#lustre_subnet_cidr:
43
#lustre_mgs_nid:
5-
#lustre_fs_name:
4+
lustre_fs_name: lustre
65
lustre_mount_point: "/mnt/lustre/{{ lustre_fs_name }}"
76
lustre_mount_state: mounted
87

ansible/roles/lustre/tasks/configure.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,34 +16,34 @@
1616
that: _lustre_interface is defined
1717
fail_msg: "No interface was found for lustre_subnet_cidr={{ lustre_subnet_cidr }}"
1818

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
19+
# - name: Write LNet configuration file
20+
# template:
21+
# src: lnet.conf.j2
22+
# dest: /etc/lnet.conf # exists from package install, expected by lnet service
23+
# owner: root
24+
# group: root
25+
# mode: u=rw,go=r # from package install
26+
# register: _lnet_conf
2727

28-
- name: Import LNet configuration
29-
command: lnetctl import /etc/lnet.conf
30-
when: _lnet_conf.changed
28+
# - name: Ensure lnet service state
29+
# systemd_service:
30+
# name: lnet
31+
# state: "'restarted' if _lnet_conf.changed else 'started'"
32+
# when: _lnet_conf.changed
3133

3234
- name: Ensure mount points exist
3335
ansible.builtin.file:
34-
path: "{{ item.mount_point | default(lustre_mount_point) }}/{{ item.fs_name | default(lustre_fs_name) }}"
36+
path: "{{ lustre_mount_point }}"
3537
state: directory
36-
loop: "{{ lustre_mounts }}"
37-
when: "item.mount_state | default(lustre_mount_state) != 'absent'"
38+
when: "lustre_mount_state != 'absent'"
3839
# TODO: do we need to set owner/group/mode either pre- or post-mount?
3940

4041
# TODO: is this an ok way of doing it?
4142
- name: Mount lustre filesystem
4243
ansible.posix.mount:
4344
fstype: lustre
44-
src: "{{ item.mgs_nid | default(lustre_mgs_nid) }}:/{{ item.lustre_fs_name | default(lustre_fs_name) }}"
45-
path: "{{ item.mount_point | default(lustre_mount_point) }}/{{ item.fs_name | default(lustre_fs_name) }}"
45+
src: "{{ lustre_mgs_nid }}:/{{ lustre_fs_name }}"
46+
path: "{{ lustre_mount_point }}"
4647
state: "{{ lustre_mount_state }}"
4748
opts: "defaults,_netdev,noauto,x-systemd.automount,x-systemd.requires=lnet.service"
4849
# opts are systemd defaults from http://wiki.lustre.org/Mounting_a_Lustre_File_System_on_Client_Nodes
49-
loop: "{{ lustre_mounts }}"

0 commit comments

Comments
 (0)