Skip to content

Commit 62573c8

Browse files
committed
feat(config/plugstack): allow file to be absent
1 parent c46fa31 commit 62573c8

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

manifests/config/plugstack.pp

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@
1919
# Slurm's spank.h header file, added to the SPANK config file plugstack.conf,
2020
# and they will be loaded at runtime during the next job launch
2121
#
22-
class slurm::config::plugstack inherits slurm::config {
22+
#
23+
# @param ensure
24+
# Should the spank config file be present
25+
#
26+
class slurm::config::plugstack (
27+
Boolean $ensure = true
28+
) inherits slurm::config {
2329
$plugstack_content = $slurm::plugstack_content ? {
2430
undef => $slurm::plugstack_source ? {
2531
undef => $slurm::plugstack_target ? {
@@ -30,15 +36,19 @@
3036
},
3137
default => $slurm::plugstack_content,
3238
}
33-
$ensure = $slurm::plugstack_target ? {
34-
undef => $slurm::ensure,
35-
default => 'link',
39+
40+
$plugstack_configfile_ensure = absent
41+
if $ensure {
42+
$plugstack_configfile_ensure = $slurm::plugstack_target ? {
43+
undef => $slurm::ensure,
44+
default => 'link',
45+
}
3646
}
3747

3848
$plugstack_filename = "${slurm::configdir}/${slurm::params::plugstack_configfile}"
3949

4050
file { $slurm::params::plugstack_configfile:
41-
ensure => $ensure,
51+
ensure => $plugstack_configfile_ensure,
4252
path => $plugstack_filename,
4353
owner => $slurm::username,
4454
group => $slurm::group,

0 commit comments

Comments
 (0)