Puppet Class: lmod::load

Defined in:
manifests/load.pp

Summary

Manage Lmod load config files

Overview



3
4
5
6
7
8
9
10
11
12
13
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'manifests/load.pp', line 3

class lmod::load {
  assert_private()

  # Remove files installed by OS where path maybe different
  if $facts['os']['family'] == 'RedHat' {
    if $lmod::modules_bash_path != '/etc/profile.d/00-modulepath.sh' {
      file { '/etc/profile.d/00-modulepath.sh': ensure => 'absent' }
    }
    if $lmod::modules_csh_path != '/etc/profile.d/00-modulepath.csh' {
      file { '/etc/profile.d/00-modulepath.csh': ensure => 'absent' }
    }
    if $lmod::modules_bash_path != '/etc/profile.d/z00_lmod.sh' {
      file { '/etc/profile.d/z00_lmod.sh': ensure => 'absent' }
    }
    if $lmod::modules_csh_path != '/etc/profile.d/z00_lmod.csh' {
      file { '/etc/profile.d/z00_lmod.csh': ensure => 'absent' }
    }
  }

  # Template uses:
  # - $modulepath_root
  # - $modulepaths
  # - $prefix
  # - $set_lmod_package_path
  # - $avail_styles
  # - $lmod_admin_file
  # - $ps_cmd
  # - $expr_cmd
  # - $basename_cmd
  file { 'lmod-sh-load':
    ensure  => $lmod::_file_ensure,
    path    => $lmod::modules_bash_path,
    content => $lmod::_modules_bash_content,
    source  => $lmod::_modules_bash_source,
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
  }

  # Template uses:
  # - $modulepath_root
  # - $modulepaths
  # - $prefix
  # - $set_lmod_package_path
  # - $avail_styles
  # - $lmod_admin_file
  file { 'lmod-csh-load':
    ensure  => $lmod::_file_ensure,
    path    => $lmod::modules_csh_path,
    content => $lmod::_modules_csh_content,
    source  => $lmod::_modules_csh_source,
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
  }

  if $lmod::set_default_module {
    # Template uses:
    # - $default_module
    file { '/etc/profile.d/z00_StdEnv.sh':
      ensure  => $lmod::_file_ensure,
      path    => $lmod::stdenv_bash_path,
      content => $lmod::_stdenv_bash_content,
      source  => $lmod::_stdenv_bash_source,
      owner   => 'root',
      group   => 'root',
      mode    => '0644',
    }

    # Template uses:
    # - $default_module
    file { 'z00_StdEnv.csh':
      ensure  => $lmod::_file_ensure,
      path    => $lmod::stdenv_csh_path,
      content => $lmod::_stdenv_csh_content,
      source  => $lmod::_stdenv_csh_source,
      owner   => 'root',
      group   => 'root',
      mode    => '0644',
    }
  } else {
    file { '/etc/profile.d/z00_StdEnv.sh':
      ensure => absent,
      path   => $lmod::stdenv_bash_path,
    }

    file { 'z00_StdEnv.csh':
      ensure => absent,
      path   => $lmod::stdenv_csh_path,
    }
  }

}