Defined Type: slurm::job_container

Defined in:
manifests/job_container.pp

Summary

Manage SLURM job_container.conf entry

Overview

Parameters:

  • base_path (Stdlib::Absolutepath)

    job_container.conf BasePath

  • auto_base_path (Boolean) (defaults to: false)

    job_container.conf AutoBasePath

  • init_script (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    job_container.conf InitScript

  • node_name (Optional[String]) (defaults to: undef)

    job_container.conf NodeName

  • order (Any) (defaults to: '50')

    Order in job_container.conf



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,
  }

}