Skip to content

Commit a93757f

Browse files
authored
Merge branch 'main' into feat/sssd-sshd-compute-init
2 parents 5866357 + 9a8f123 commit a93757f

File tree

9 files changed

+78
-13
lines changed

9 files changed

+78
-13
lines changed

ansible/bootstrap.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@
126126
ansible.builtin.assert:
127127
that: dnf_repos_password is undefined
128128
fail_msg: Passwords should not be templated into repofiles during configure, unset 'dnf_repos_password'
129-
when: appliances_mode == 'configure'
129+
when:
130+
- appliances_mode == 'configure'
131+
- not (dnf_repos_allow_insecure_creds | default(false)) # useful for development
130132

131133
- hosts: squid
132134
tags: squid

ansible/roles/compute_init/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ it also requires an image build with the role name added to the
4949
| bootstrap.yml | sshd | None at present | No |
5050
| bootstrap.yml | dnf_repos | None at present [2] | - |
5151
| bootstrap.yml | squid | Not relevant for compute nodes | n/a |
52-
| bootstrap.yml | tuned | None | - |
52+
| bootstrap.yml | tuned | Fully supported | No |
5353
| bootstrap.yml | freeipa_server | Not relevant for compute nodes | n/a |
5454
| bootstrap.yml | cockpit | None required - use image build | No |
5555
| bootstrap.yml | firewalld | Not relevant for compute nodes | n/a |

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

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
enable_compute: "{{ os_metadata.meta.compute | default(false) | bool }}"
1010
enable_resolv_conf: "{{ os_metadata.meta.resolv_conf | default(false) | bool }}"
1111
enable_etc_hosts: "{{ os_metadata.meta.etc_hosts | default(false) | bool }}"
12+
enable_tuned: "{{ os_metadata.meta.tuned | default(false) | bool }}"
1213
enable_nfs: "{{ os_metadata.meta.nfs | default(false) | bool }}"
1314
enable_manila: "{{ os_metadata.meta.manila | default(false) | bool }}"
1415
enable_basic_users: "{{ os_metadata.meta.basic_users | default(false) | bool }}"
@@ -22,6 +23,12 @@
2223
sssd_started: true
2324
sssd_enabled: true
2425

26+
tuned_profile_baremetal: hpc-compute
27+
tuned_profile_vm: virtual-guest
28+
tuned_profile: "{{ tuned_profile_baremetal if ansible_virtualization_role != 'guest' else tuned_profile_vm }}"
29+
tuned_enabled: true
30+
tuned_started: true
31+
2532
nfs_client_mnt_point: "/mnt"
2633
nfs_client_mnt_options:
2734
nfs_client_mnt_state: mounted
@@ -64,9 +71,9 @@
6471
file:
6572
path: /mnt/cluster
6673
state: directory
67-
owner: root
74+
owner: slurm
6875
group: root
69-
mode: u=rwX,go= # is sensitive
76+
mode: u=rX,g=rwX,o=
7077

7178
- name: Mount /mnt/cluster
7279
mount:
@@ -162,6 +169,10 @@
162169
when: "'sssd' not in _authselect_current.stdout"
163170
when: enable_sssd
164171

172+
- name: Configure tuned
173+
include_tasks: tasks/tuned.yml
174+
when: enable_tuned
175+
165176
# NFS client mount
166177
- name: If nfs-clients is present
167178
include_tasks: tasks/nfs-clients.yml
@@ -313,6 +324,27 @@
313324
enabled: true
314325
state: started
315326

327+
- name: Set locked memory limits on user-facing nodes
328+
lineinfile:
329+
path: /etc/security/limits.conf
330+
regexp: '\* soft memlock unlimited'
331+
line: "* soft memlock unlimited"
332+
333+
- name: Configure sshd pam module
334+
blockinfile:
335+
path: /etc/pam.d/sshd
336+
insertafter: 'account\s+required\s+pam_nologin.so'
337+
block: |
338+
account sufficient pam_access.so
339+
account required pam_slurm.so
340+
341+
- name: Configure login access control
342+
blockinfile:
343+
path: /etc/security/access.conf
344+
block: |
345+
+:adm:ALL
346+
-:ALL:ALL
347+
316348
- name: Ensure node is resumed
317349
# TODO: consider if this is always safe for all job states?
318350
command: scontrol update state=resume nodename={{ ansible_hostname }}

ansible/roles/compute_init/tasks/install.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
dest: files/NetworkManager-dns-none.conf
3333
- src: ../../basic_users/filter_plugins/filter_keys.py
3434
dest: filter_plugins/filter_keys.py
35+
- src: ../../tuned/tasks/configure.yml
36+
dest: tasks/tuned.yml
3537
- src: ../../stackhpc.nfs/tasks/nfs-clients.yml
3638
dest: tasks/nfs-clients.yml
3739

ansible/roles/lustre/tasks/configure.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
- name: Gather Lustre interface info
22
shell:
33
cmd: |
4-
ip r get {{ _lustre_mgs_ip }}
4+
ip --json r get {{ _lustre_mgs_ip }}
55
changed_when: false
66
register: _lustre_ip_r_mgs
77
vars:
88
_lustre_mgs_ip: "{{ lustre_mgs_nid | split('@') | first }}"
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.dev }}"
13+
_lustre_ip: "{{ _lustre_ip_r_mgs_info.prefsrc }}"
1414
vars:
15-
_lustre_ip_r_mgs_info: "{{ _lustre_ip_r_mgs.stdout_lines.0 | split }}"
16-
# first line e.g. "10.167.128.1 via 10.179.0.2 dev eth0 src 10.179.3.149 uid 1000"
15+
_lustre_ip_r_mgs_info: "{{ _lustre_ip_r_mgs.stdout | from_json | first }}"
1716

1817
- name: Write LNet configuration file
1918
template:
@@ -44,4 +43,3 @@
4443
state: "{{ (item.mount_state | default(lustre_mount_state)) }}"
4544
opts: "{{ item.mount_options | default(lustre_mount_options) }}"
4645
loop: "{{ lustre_mounts }}"
47-

ansible/roles/sshd/tasks/configure.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
- name: Grab facts to determine distribution
2+
setup:
3+
4+
- name: Ensure drop in directory exists
5+
file:
6+
path: /etc/ssh/sshd_config.d/*.conf
7+
state: directory
8+
owner: root
9+
group: root
10+
mode: 700
11+
become: true
12+
13+
- name: Ensure drop in directory is included
14+
blockinfile:
15+
dest: /etc/ssh/sshd_config
16+
content: |
17+
# To modify the system-wide sshd configuration, create a *.conf file under
18+
# /etc/ssh/sshd_config.d/ which will be automatically included below
19+
Include /etc/ssh/sshd_config.d/*.conf
20+
state: present
21+
insertafter: "# default value."
22+
validate: sshd -t -f %s
23+
notify:
24+
- Restart sshd
25+
become: true
26+
when: ansible_facts.distribution_major_version == '8'
27+
128
- name: Template sshd configuration
229
# NB: If parameters are defined multiple times the first value wins;
330
# The default /etc/ssh/sshd_config has

environments/.stackhpc/inventory/extra_groups

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ cluster
2424
login
2525
compute
2626

27+
[tuned:children]
28+
# Install tuned into fat image
29+
builder
30+
2731
[squid:children]
2832
# Install squid into fat image
2933
builder
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"cluster_image": {
3-
"RL8": "openhpc-RL8-250130-1126-8f2a7703",
4-
"RL9": "openhpc-RL9-250130-1127-8f2a7703"
3+
"RL8": "openhpc-RL8-250211-1540-a0b4a57e",
4+
"RL9": "openhpc-RL9-250211-1540-a0b4a57e"
55
}
66
}

environments/.stackhpc/tofu/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ module "cluster" {
8080
standard: { # NB: can't call this default!
8181
nodes: ["compute-0", "compute-1"]
8282
flavor: var.other_node_flavor
83-
compute_init_enable: ["compute", "etc_hosts", "nfs", "basic_users", "eessi"]
83+
compute_init_enable: ["compute", "etc_hosts", "nfs", "basic_users", "eessi", "tuned"]
8484
ignore_image_changes: true
8585
}
8686
# Example of how to add another partition:

0 commit comments

Comments
 (0)