Skip to content

Commit 3b719df

Browse files
authored
Fix sssd & sshd for slurm-controlled rebuild (#866)
* use ansible-init user for cluster share * fix pointless linter errors * bump CI image * fix ansible-init gid * bump CI image * try to workaround user creation hanging in-cluster * bump CI image * revert manila changes * bump CI image
1 parent 6bae119 commit 3b719df

File tree

9 files changed

+47
-39
lines changed

9 files changed

+47
-39
lines changed

ansible/roles/cacerts/tasks/export.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
ansible.builtin.copy:
44
src: "{{ item }}"
55
dest: /exports/cluster/cacerts/
6-
owner: slurm
7-
group: root
8-
mode: "0644"
6+
owner: ansible-init
7+
group: ansible-init
8+
mode: u=rw,go=
99
with_fileglob:
1010
- "{{ cacerts_cert_dir }}/*"
1111
delegate_to: "{{ groups['control'] | first }}"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
- ansible.builtin.meta: end_play
8484
- name: Check if hostvars exist
8585
become: true
86-
become_user: slurm
86+
become_user: ansible-init # share is root-squashed
8787
ansible.builtin.stat:
8888
path: "/mnt/cluster/hostvars/{{ ansible_hostname }}/hostvars.yml"
8989
register: hostvars_stat
@@ -98,7 +98,7 @@
9898
- ansible.builtin.meta: end_play
9999
- name: Sync /mnt/cluster to /var/tmp
100100
become: true
101-
become_user: slurm
101+
become_user: ansible-init # share is root-squashed
102102
ansible.posix.synchronize:
103103
src: "/mnt/cluster/"
104104
dest: "/var/tmp/cluster/"

ansible/roles/compute_init/tasks/export.yml

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,47 @@
11
---
2-
- name: Ensure the /exports/cluster directory exists
2+
- name: Ensure /exports/cluster directory structure exists
33
ansible.builtin.file:
4-
path: /exports/cluster
4+
path: "{{ item }}"
55
state: directory
6-
owner: slurm
7-
group: root
6+
owner: ansible-init
7+
group: ansible-init
88
mode: u=rX,g=rwX,o=
99
run_once: true
10+
loop:
11+
- /exports/cluster
12+
- /exports/cluster/hostvars
13+
- /exports/cluster/cacerts
14+
- /exports/cluster/cvmfs
15+
- /exports/cluster/hostconfig
1016
delegate_to: "{{ groups['control'] | first }}"
1117

1218
- name: Copy /etc/hosts to /exports/cluster
1319
ansible.builtin.copy:
1420
src: /etc/hosts
1521
dest: /exports/cluster/hosts
16-
owner: slurm
17-
group: root
18-
mode: u=r,g=rw,o=
22+
owner: ansible-init
23+
group: ansible-init
24+
mode: u=rw,go=r
1925
remote_src: true
2026
run_once: true
2127
delegate_to: "{{ groups['control'] | first }}"
2228

23-
- name: Create hostvars directory
29+
- name: Create per-host hostvars directory
2430
ansible.builtin.file:
2531
path: /exports/cluster/hostvars/{{ inventory_hostname }}/
2632
state: directory
27-
owner: slurm
28-
group: root
29-
mode: u=rX,g=rwX,o=
33+
owner: ansible-init
34+
group: ansible-init
35+
mode: u=rwX,go=
3036
delegate_to: "{{ groups['control'] | first }}"
3137

3238
- name: Template out hostvars
3339
ansible.builtin.template:
3440
src: hostvars.yml.j2
3541
dest: /exports/cluster/hostvars/{{ inventory_hostname }}/hostvars.yml
36-
owner: slurm
37-
group: root
38-
mode: u=r,g=rw,o=
42+
owner: ansible-init
43+
group: ansible-init
44+
mode: u=rw,go=
3945
delegate_to: "{{ groups['control'] | first }}"
4046

4147
- name: Copy manila share info to /exports/cluster
@@ -52,29 +58,19 @@
5258
os_manila_mount_share_info_var:
5359
os_manila_mount_share_info: "{{ os_manila_mount_share_info }}"
5460

55-
- name: Ensure /exports/cluster/cvmfs directory exists
56-
ansible.builtin.file:
57-
path: /exports/cluster/cvmfs
58-
state: directory
59-
owner: slurm
60-
group: root
61-
mode: "0755"
62-
run_once: true
63-
delegate_to: "{{ groups['control'] | first }}"
64-
6561
- name: Export cacerts
6662
ansible.builtin.include_role:
6763
name: cacerts
6864
tasks_from: export.yml
6965
when: "'cacerts' in group_names"
7066

71-
- name: Create hostconfig directory
67+
- name: Create per-host hostconfig directory
7268
ansible.builtin.file:
7369
path: "/exports/cluster/hostconfig/{{ inventory_hostname }}/"
7470
state: directory
75-
owner: slurm
76-
group: root
77-
mode: u=rX,g=rwX,o=
71+
owner: ansible-init
72+
group: ansible-init
73+
mode: u=rwX,go=
7874
delegate_to: "{{ groups['control'] | first }}"
7975

8076
- name: Template sssd config

ansible/roles/nhc/tasks/export.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
ansible.builtin.template:
44
src: "{{ nhc_config_template }}"
55
dest: "/exports/cluster/hostconfig/{{ inventory_hostname }}/nhc.conf"
6-
mode: "0644"
6+
owner: ansible-init
7+
group: ansible-init
8+
mode: u=rw,go=
79
delegate_to: "{{ groups['control'] | first }}"

ansible/roles/sssd/tasks/export.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
ansible.builtin.template:
55
src: "{{ sssd_conf_src }}"
66
dest: "/exports/cluster/hostconfig/{{ inventory_hostname }}/sssd.conf"
7-
owner: root
8-
group: root
7+
owner: ansible-init
8+
group: ansible-init
99
mode: u=rw,go=
1010
delegate_to: "{{ groups['control'] | first }}"

dev/image-set-properties.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ openstack image set \
1717
--property hw_architecture=x86_64 \
1818
--property hw_vif_multiqueue_enabled=true \
1919
--property hw_firmware_type=uefi \
20-
--property os_distro=rocky \
2120
--property os_type=linux \
2221
--property os_admin_user=rocky \
2322
"$image"
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-251211-0951-51b93e3f",
4-
"RL9": "openhpc-RL9-251211-0951-51b93e3f"
3+
"RL8": "openhpc-RL8-251213-1133-31273766",
4+
"RL9": "openhpc-RL9-251213-1133-31273766"
55
}
66
}

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ appliances_local_users_default:
7878
system: true
7979
enable: "{{ 'grafana' in group_names }}"
8080

81+
- user:
82+
name: ansible-init
83+
comment: ansible-init user
84+
uid: 301
85+
create_home: false
86+
home: /var/lib/ansible-init
87+
shell: /sbin/nologin
88+
system: true
89+
enable: "{{ 'ansible_init' in group_names }}"
90+
8191
# Overide this to add extra users whilst keeping the defaults.
8292
appliances_local_users_extra: [] # see format of appliances_local_users_default above
8393
appliances_local_users: "{{ (appliances_local_users_default + appliances_local_users_extra) | select | list }}"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ nfs_configuration_compute_nodes: # cluster configuration for compute_init/slurm-
3131
server: "{{ inventory_hostname in groups['control'] }}"
3232
clients: false
3333
nfs_export: "/exports/cluster"
34+
nfs_export_options: "ro,secure,root_squash"
3435

3536
nfs_configurations_extra: [] # site-specific nfs shares
3637

0 commit comments

Comments
 (0)