|
9 | 9 | enable_compute: "{{ os_metadata.meta.compute | default(false) | bool }}"
|
10 | 10 | enable_resolv_conf: "{{ os_metadata.meta.resolv_conf | default(false) | bool }}"
|
11 | 11 | enable_etc_hosts: "{{ os_metadata.meta.etc_hosts | default(false) | bool }}"
|
| 12 | + enable_tuned: "{{ os_metadata.meta.tuned | default(false) | bool }}" |
12 | 13 | enable_nfs: "{{ os_metadata.meta.nfs | default(false) | bool }}"
|
13 | 14 | enable_manila: "{{ os_metadata.meta.manila | default(false) | bool }}"
|
14 | 15 | enable_basic_users: "{{ os_metadata.meta.basic_users | default(false) | bool }}"
|
|
22 | 23 | sssd_started: true
|
23 | 24 | sssd_enabled: true
|
24 | 25 |
|
| 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 | + |
25 | 32 | nfs_client_mnt_point: "/mnt"
|
26 | 33 | nfs_client_mnt_options:
|
27 | 34 | nfs_client_mnt_state: mounted
|
|
64 | 71 | file:
|
65 | 72 | path: /mnt/cluster
|
66 | 73 | state: directory
|
67 |
| - owner: root |
| 74 | + owner: slurm |
68 | 75 | group: root
|
69 |
| - mode: u=rwX,go= # is sensitive |
| 76 | + mode: u=rX,g=rwX,o= |
70 | 77 |
|
71 | 78 | - name: Mount /mnt/cluster
|
72 | 79 | mount:
|
|
162 | 169 | when: "'sssd' not in _authselect_current.stdout"
|
163 | 170 | when: enable_sssd
|
164 | 171 |
|
| 172 | + - name: Configure tuned |
| 173 | + include_tasks: tasks/tuned.yml |
| 174 | + when: enable_tuned |
| 175 | + |
165 | 176 | # NFS client mount
|
166 | 177 | - name: If nfs-clients is present
|
167 | 178 | include_tasks: tasks/nfs-clients.yml
|
|
313 | 324 | enabled: true
|
314 | 325 | state: started
|
315 | 326 |
|
| 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 | +
|
316 | 348 | - name: Ensure node is resumed
|
317 | 349 | # TODO: consider if this is always safe for all job states?
|
318 | 350 | command: scontrol update state=resume nodename={{ ansible_hostname }}
|
|
0 commit comments