Skip to content

Commit ce1f245

Browse files
committed
fix(conf): run slurm-web-agent auth local as slurm
Run Slurm-web agent as slurm special user when authentication is local.
1 parent ee67876 commit ce1f245

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ and this project adheres to
1212
- conf: Add pkgs.rackslab.io packages repositories by default.
1313

1414
### Fixed
15-
- conf: Slurm-web v5 JWT for slurmrestd authentification ownership.
15+
- conf:
16+
- Slurm-web v5 JWT for slurmrestd authentification ownership.
17+
- Run Slurm-web agent as slurm special user when authentication is local.
1618

1719
## [1.2.0] - 2025-09-18
1820

conf/roles/slurmweb/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ slurmweb_slurmrestd_jwt_key: /var/lib/slurm-web/slurmrestd_jwt_hs256.key
1111
slurmweb_slurmrestd_jwt_token: null
1212
slurmweb_local_slurmrestd_jwt_key_file: jwt_hs256.key # dummy
1313
slurmweb_agent_subdir: agent
14+
slurmweb_agent_service_override_path: /etc/systemd/system/slurm-web-agent-uwsgi.service.d/firehpc.conf
1415
slurmweb_agent_settings_defaults: {}
1516
slurmweb_gateway_settings_defaults: {}
1617
slurmweb_agent_settings: {}

conf/roles/slurmweb/tasks/main.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
#
5151
- name: Create JWT signing key
5252
ansible.builtin.command:
53-
cmd: /usr/libexec/slurm-web/slurm-web-gen-jwt-key
53+
cmd: "/usr/libexec/slurm-web/slurm-web-gen-jwt-key{% if slurmweb_slurmrestd_auth == 'local' %} --with-slurm{% endif %}"
5454
creates: "{{ slurmweb_jwt_key }}"
5555

5656
- name: Install systemd services for components
@@ -65,6 +65,30 @@
6565
- agent
6666
- gateway
6767

68+
- name: Setup slurm-web agent to run as slurm system user
69+
block:
70+
- name: Create slurm-web agent service override directory
71+
ansible.builtin.file:
72+
path: "{{ slurmweb_agent_service_override_path | dirname }}"
73+
state: directory
74+
owner: root
75+
group: root
76+
mode: 0755
77+
78+
- name: Deploy slurm-web agent service override file
79+
ansible.builtin.copy:
80+
content: |
81+
[Service]
82+
User=slurm
83+
Group=slurm
84+
dest: "{{ slurmweb_agent_service_override_path }}"
85+
owner: slurm
86+
group: slurm
87+
mode: 0644
88+
notify: Restart slurm-web-agent uWSGI
89+
when:
90+
- slurmweb_slurmrestd_auth == 'local'
91+
6892
- name: Ensure Slurm-web uWGSI are started
6993
ansible.builtin.systemd_service:
7094
name: "slurm-web-{{ item }}-uwsgi"

0 commit comments

Comments
 (0)