Puppet Class: lmod

Defined in:
manifests/init.pp

Summary

Manage Lmod

Overview

Examples:

To install Lmod from existing package repositories

class { 'lmod':
   install_method => 'package',
 }

Parameters:

  • ensure (Enum['present','absent']) (defaults to: 'present')

    The ensure parameter for this module. If set to 'absent', managed files are removed. If lmod_package_from_repo is true and ensure is 'absent', then the lmod package is also removed.

  • version (String) (defaults to: '8.4.26')

    Version of Lmod to install when installing from source

  • package_ensure (String) (defaults to: 'present')

    The ensure value for Lmod package. Only applies when lmod_package_from_repo is true.

  • prefix (Stdlib::Absolutepath) (defaults to: '/usr/share')

    The prefix used when lmod was compiled.

  • install_method (Enum['package','source','none']) (defaults to: 'package')

    How Lmod should be installed

  • manage_epel (Boolean) (defaults to: true)

    Boolean that determines if EPEL should be mananged by this module for systems installing Lmod via yum.

  • source_dir (Stdlib::Absolutepath) (defaults to: '/usr/src')

    Directory to store Lmod source

  • source_with_flags (Hash) (defaults to: {})

    Key/value pair of flags to turn into –with-<key>=<value> passed to configure when installing from source

  • package_name (String) (defaults to: 'Lmod')

    Lmod package name if lmod_package_from_repo is true.

  • runtime_packages (Array) (defaults to: [])

    Lmod runtime package dependencies, only installed if lmod_package_from_repo is false

  • build_packages (Array) (defaults to: [])

    Lmod runtime devel package dependencies, only installed if manage_build_packages is true

  • manage_alternatives (Boolean) (defaults to: true)

    Sets whether alternatives are managed by this module Only used for Debian and Ubuntu systems

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

    The modulepath for your lmod installation. Default is 'UNSET'. If the value is 'UNSET' then the path $prefix/modulefiles is used.

  • modulepaths (Array) (defaults to: ['$LMOD_sys', 'Core'])

    An Array of modulepaths to be defined in the module.sh and module.csh.

  • set_lmod_package_path (Boolean) (defaults to: false)

    Boolean that determines if the LMOD_PACKAGE_PATH environment variable should be set in modules.sh and modules.csh.

  • lmod_package_path (String) (defaults to: '$MODULEPATH_ROOT/Site')

    Value given to the LMOD_PACKAGE_PATH environment variable in modules.sh and modules.csh.

  • set_default_module (Boolean) (defaults to: false)

    Boolean will disable the management of the files that define the default module.

  • default_module (String) (defaults to: 'StdEnv')

    The name of the default module to be loaded when users login. This will not be set if set_default_module is false.

  • avail_styles (Array) (defaults to: ['system'])

    An Array used to set the LMOD_AVAIL_STYLES environment variable. An empty Array prevents this environment variable from being set.

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

    Defines path used for LMOD_ADMIN_FILE.

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

    Value used for LMOD_SYSTEM_NAME.

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

    Value used for LMOD_SITE_NAME.

  • cached_loads (Optional[Boolean]) (defaults to: undef)

    Value used for LMOD_CACHED_LOADS.

  • modules_bash_path (Stdlib::Absolutepath) (defaults to: '/etc/profile.d/modules.sh')

    Path to script to load bash modules environment

  • modules_bash_template (String) (defaults to: 'lmod/modules.sh.erb')

    Module bash load template

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

    Module bash load source

  • modules_csh_path (Stdlib::Absolutepath) (defaults to: '/etc/profile.d/modules.csh')

    Path to script to load csh modules environment

  • modules_csh_template (String) (defaults to: 'lmod/modules.csh.erb')

    Module csh load template

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

    Module csh load source

  • stdenv_bash_path (Stdlib::Absolutepath) (defaults to: '/etc/profile.d/z00_StdEnv.sh')

    Path to bash script that loads default modules

  • stdenv_bash_template (String) (defaults to: 'lmod/z00_StdEnv.sh.erb')

    Default module bash load template

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

    Default module bash load source

  • stdenv_csh_path (Stdlib::Absolutepath) (defaults to: '/etc/profile.d/z00_StdEnv.csh')

    Path to csh script that loads default modules

  • stdenv_csh_template (String) (defaults to: 'lmod/z00_StdEnv.csh.erb')

    Default module csh load template

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

    Default module bash load source



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'manifests/init.pp', line 84

class lmod (
  Enum['present','absent'] $ensure                  = 'present',
  String $version                                   = '8.4.26',
  String $package_ensure                            = 'present',
  Stdlib::Absolutepath $prefix                      = '/usr/share',
  Enum['package','source','none'] $install_method   = 'package',
  Boolean $manage_epel                              = true,
  Stdlib::Absolutepath $source_dir                  = '/usr/src',
  Hash $source_with_flags                           = {},
  String $package_name                              = 'Lmod',
  Array $runtime_packages                           = [],
  Array $build_packages                             = [],
  Boolean $manage_alternatives                      = true,
  Optional[Stdlib::Absolutepath] $modulepath_root   = undef,
  Array $modulepaths                                = ['$LMOD_sys', 'Core'],
  Boolean $set_lmod_package_path                    = false,
  String $lmod_package_path                         = '$MODULEPATH_ROOT/Site',
  Boolean $set_default_module                       = false,
  String $default_module                            = 'StdEnv',
  Array $avail_styles                               = ['system'],
  Optional[Stdlib::Absolutepath] $lmod_admin_file   = undef,
  Optional[String] $system_name                     = undef,
  Optional[String] $site_name                       = undef,
  Optional[Boolean] $cached_loads                   = undef,
  Stdlib::Absolutepath $modules_bash_path           = '/etc/profile.d/modules.sh',
  String $modules_bash_template                     = 'lmod/modules.sh.erb',
  Optional[String] $modules_bash_source             = undef,
  Stdlib::Absolutepath $modules_csh_path            = '/etc/profile.d/modules.csh',
  String $modules_csh_template                      = 'lmod/modules.csh.erb',
  Optional[String] $modules_csh_source              = undef,
  Stdlib::Absolutepath $stdenv_bash_path            = '/etc/profile.d/z00_StdEnv.sh',
  String $stdenv_bash_template                      = 'lmod/z00_StdEnv.sh.erb',
  Optional[String] $stdenv_bash_source              = undef,
  Stdlib::Absolutepath $stdenv_csh_path             = '/etc/profile.d/z00_StdEnv.csh',
  String $stdenv_csh_template                       = 'lmod/z00_StdEnv.csh.erb',
  Optional[String] $stdenv_csh_source               = undef,
) {

  case $ensure {
    'present': {
      $_file_ensure = 'file'
    }
    'absent': {
      $_file_ensure = 'absent'
    }
    default: {
      # Do nothing
    }
  }

  if $modules_bash_source {
    $_modules_bash_source   = $modules_bash_source
    $_modules_bash_content  = undef
  } else {
    $_modules_bash_source   = undef
    $_modules_bash_content  = template($modules_bash_template)
  }

  if $modules_csh_source {
    $_modules_csh_source   = $modules_csh_source
    $_modules_csh_content  = undef
  } else {
    $_modules_csh_source   = undef
    $_modules_csh_content  = template($modules_csh_template)
  }

  if $stdenv_bash_source {
    $_stdenv_bash_source   = $stdenv_bash_source
    $_stdenv_bash_content  = undef
  } else {
    $_stdenv_bash_source   = undef
    $_stdenv_bash_content  = template($stdenv_bash_template)
  }

  if $stdenv_csh_source {
    $_stdenv_csh_source   = $stdenv_csh_source
    $_stdenv_csh_content  = undef
  } else {
    $_stdenv_csh_source   = undef
    $_stdenv_csh_content  = template($stdenv_csh_template)
  }

  contain 'lmod::install'
  contain 'lmod::load'

  Class['lmod::install']
  -> Class['lmod::load']

}