Skip to content

Commit 82ef12b

Browse files
committed
support nfs for compute-init
1 parent b6ae045 commit 82ef12b

File tree

4 files changed

+32
-11
lines changed

4 files changed

+32
-11
lines changed

ansible/roles/compute_init/README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,12 @@ to configure the node before the services on the control node are available
3232
(which requires running the site.yml playbook).
3333

3434
The following roles are currently fully functional:
35-
- `resolv_conf`
36-
- `etc_hosts`
37-
- `stackhpc.openhpc`
35+
- `resolv_conf`: all functionality
36+
- `etc_hosts`: all functionality
37+
- `nfs`: client functionality only
38+
- `stackhpc.openhpc`: all functionality, except that the control server name
39+
must be the control node's `inventory_hostname`; `openhpc_slurm_control_host`
40+
and `openhpc_slurm_control_host_address` are ignored.
3841

3942
# Development/debugging
4043

@@ -113,7 +116,8 @@ as in step 3.
113116
More generally, there is nothing to stop any group var depending on a
114117
"{{ hostvars[] }}" interpolation ...
115118
116-
Currently, the only functionality this has been problematic for is setting
117-
the control node address for the slurmd node, which has been done using
118-
the (metadata-provided) IP, given this is needed to do the NFS mount anyway
119-
in the absence of working internal DNS.
119+
Currently, this has been worked around for the following cases:
120+
- The inventory hostname for the control node, indirected via `.api_address`
121+
in the above hostvars. This is needed for the default nfs configuration
122+
and the slurmctld namne. For compute-init this has been Defined using
123+
"{{ groups['control'] | first }}" as the hostvars do include the groups.

ansible/roles/compute_init/files/compute-init.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,17 @@
1313
# TODO: "= role defaults" - could be moved to a vars_file: on play with similar precedence effects
1414
# this is a good example: common environment actually defines this (non-functional w/o compute groups), but role default is empty
1515
resolv_conf_nameservers: []
16-
16+
17+
nfs_client_mnt_point: "/mnt"
18+
nfs_client_mnt_options:
19+
nfs_client_mnt_state: mounted
20+
nfs_configurations:
21+
nfs_enable:
22+
clients: false
23+
nfs_enable:
24+
server: false
25+
clients: false
26+
1727
tasks:
1828
- block:
1929
- name: Report skipping initialization if not compute node
@@ -95,6 +105,10 @@
95105
when: enable_etc_hosts
96106

97107
# TODO: - name: NFS client mount
108+
- name: If nfs-clients is present
109+
include_tasks: nfs-clients.yml
110+
when: nfs_enable.clients | bool or ('nfs_enable' in item and item.nfs_enable.clients | bool)
111+
loop: "{{ nfs_configurations }}"
98112

99113
# TODO: - name: Manila mount
100114

@@ -116,7 +130,7 @@
116130
- name: Set slurmctld location for configless operation
117131
lineinfile:
118132
path: /etc/sysconfig/slurmd
119-
line: "SLURMD_OPTIONS='--conf-server {{ server_node_ip }}'"
133+
line: "SLURMD_OPTIONS='--conf-server {{ groups['control'] | first }}'"
120134
regexp: "^SLURMD_OPTIONS="
121135
create: yes
122136
owner: root

ansible/roles/compute_init/tasks/install.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- files
1313
- library
1414
- filter_plugins
15+
- playbooks
1516

1617
- name: Inject files from roles
1718
copy:
@@ -33,7 +34,9 @@
3334
dest: library/os_manila_share.py
3435
- src: ../../basic_users/filter_plugins/filter_keys.py
3536
dest: filter_plugins/filter_keys.py
36-
37+
- src: ../../stackhpc.nfs/tasks/nfs-clients.yml
38+
dest: playbooks/nfs-clients.yml
39+
3740
- name: Add filter_plugins to ansible.cfg
3841
lineinfile:
3942
path: /etc/ansible-init/ansible.cfg

environments/common/inventory/group_vars/all/nfs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# See: https://github.com/stackhpc/ansible-role-cluster-nfs
44
# for variable definitions
55

6-
nfs_server_default: "{{ hostvars[groups['control'] | first ].internal_address }}"
6+
nfs_server_default: "{{ groups['control'] | first }}" # avoid using hostvars so
77

88
nfs_configurations:
99
- comment: Export /exports/home from Slurm control node as /home

0 commit comments

Comments
 (0)