14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'manifests/job_container.pp', line 14
define slurm::job_container (
Stdlib::Absolutepath $base_path,
Boolean $auto_base_path = false,
Optional[Stdlib::Absolutepath] $init_script = undef,
Optional[String] $node_name = undef,
$order = '50',
) {
include slurm
$_base_path = "BasePath=${base_path}"
$_auto_base_path = "AutoBasePath=${auto_base_path}"
if $init_script {
$_init_script = "InitScript=${init_script}"
} else {
$_init_script = undef
}
if $node_name {
$params = delete_undef_values([
"NodeName=${node_name}",
$_auto_base_path,
$_base_path,
$_init_script,
])
$content = "${strip(join($params, ' '))}\n"
} else {
$content = join(delete_undef_values([
$_auto_base_path,
$_base_path,
$_init_script,
]), "\n")
}
concat::fragment { "job_container.conf-${name}":
target => 'job_container.conf',
content => $content,
order => $order,
}
}
|