Skip to content

Commit 288d867

Browse files
author
Aman Shah
committed
Merge pull request 'update slurm module and fix the bug for jwt_key' (#1404) from sluem_web into master
Reviewed-on: https://gitea.obmondo.com/EnableIT/LinuxAid/pulls/1404
2 parents d7461df + ceae87d commit 288d867

File tree

5 files changed

+36
-25
lines changed

5 files changed

+36
-25
lines changed
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
type Eit_types::Slurm::Policy = Struct[{
2-
'roles' => Struct[{
3-
'user' => Variant[String, Array[String]],
4-
'admin' => Variant[String, Array[String]],
5-
}],
6-
'user' => Struct[{
2+
'roles' => Optional[Struct[{
3+
'user' => Optional[Variant[String, Array[String]]],
4+
'admin' => Optional[Variant[String, Array[String]]],
5+
}]],
6+
'user' => Optional[Struct[{
77
'actions' => Variant[String, Array[String]],
8-
}],
9-
'admin' => Struct[{
8+
}]],
9+
'admin' => Optional[Struct[{
1010
'actions' => Variant[String, Array[String]],
11-
}],
11+
}]],
1212
}]

modules/enableit/profile/manifests/computing/slurm.pp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -157,18 +157,6 @@
157157
}
158158
}
159159

160-
package { ['libjwt', 'libjwt-devel']:
161-
ensure => ensure_present($_jwt_key),
162-
noop => $noop_value,
163-
}
164-
165-
file { '/var/spool/slurm/jwt_hs256.key':
166-
ensure => ensure_file($_jwt_key),
167-
source => eit_files::to_file($jwt_key)['source'],
168-
noop => $noop_value,
169-
require => Package['libjwt', 'libjwt-devel'],
170-
}
171-
172160
if !$enable {
173161
package::remove( ['slurm', 'slurm-slurmdbd', 'slurm-slurmctld', 'slurm-slurmd', 'munge'])
174162
}

modules/enableit/profile/manifests/computing/slurm/slurm_web.pp

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,12 @@
9292
# actions: 'view-partitions,view-qos,view-accounts,view-reservations'
9393
#
9494
class profile::computing::slurm::slurm_web (
95-
Boolean $enable = $::role::computing::slurm::slurm_web,
96-
Boolean $noop_value = $::role::computing::slurm::noop_value,
97-
Eit_types::Slurm::Agent $agent = $::role::computing::slurm::slurm_agent,
98-
Eit_types::Slurm::Gateway $gateway = $::role::computing::slurm::slurm_gateway,
99-
Eit_types::Slurm::Policy $policy = $::role::computing::slurm::slurm_policy,
95+
Boolean $enable = $::role::computing::slurm::slurm_web,
96+
Boolean $noop_value = $::role::computing::slurm::noop_value,
97+
Optional[Eit_Files::Source] $jwt_key = $::role::computing::slurm::jwt_key,
98+
Eit_types::Slurm::Agent $agent = $::role::computing::slurm::slurm_agent,
99+
Eit_types::Slurm::Gateway $gateway = $::role::computing::slurm::slurm_gateway,
100+
Eit_types::Slurm::Policy $policy = $::role::computing::slurm::slurm_policy,
100101
) {
101102

102103
# -------------------------------------------------------
@@ -123,6 +124,12 @@
123124
noop => $noop_value,
124125
}
125126

127+
package { ['libjwt', 'libjwt-devel']:
128+
ensure => ensure_present($enable),
129+
noop => $noop_value,
130+
}
131+
132+
126133
# -------------------------------------------------------
127134
# Systemd override for slurmrestd
128135
# -------------------------------------------------------
@@ -175,6 +182,13 @@
175182
noop => $noop_value,
176183
}
177184

185+
file { '/var/spool/slurm/jwt_hs256.key':
186+
ensure => ensure_file($enable),
187+
source => eit_files::to_file($jwt_key)['source'],
188+
noop => $noop_value,
189+
require => Package['libjwt', 'libjwt-devel'],
190+
}
191+
178192
file { '/etc/slurm-web/agent.ini':
179193
ensure => ensure_file($enable),
180194
noop => $noop_value,

modules/enableit/profile/templates/computing/slurm/slurmweb/policy.ini.epp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,19 @@
77
# THIS FILE IS MANAGED BY PUPPET.
88

99
[roles]
10+
<% if $policy['roles']['user'] { -%>
1011
user=<%= Array($policy['roles']['user']).join(',') %>
12+
<% } -%>
13+
<% if $policy['roles']['admin'] { -%>
1114
admin=<%= Array($policy['roles']['admin']).join(',') %>
15+
<% } -%>
1216

17+
<% if $policy['roles']['user'] { -%>
1318
[user]
1419
actions=<%= Array($policy['user']['actions']).join(',') %>
20+
<% } -%>
1521

22+
<% if $policy['roles']['admin'] { -%>
1623
[admin]
1724
actions=<%= Array($policy['admin']['actions']).join(',') %>
25+
<% } -%>

modules/enableit/role/manifests/computing/slurm.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
contain 'profile::computing::slurm::slurm_web'
8181

8282
if $slurm_web {
83+
contain profile::computing::slurm::slurm_web
8384
contain role::web::haproxy
8485
}
8586
}

0 commit comments

Comments
 (0)