Defined Type: psick::limits::config

Defined in:
manifests/limits/config.pp

Overview

Define: psick::limits::config

This define configures a limits file under /etc/security/limits.d File name, unless specified by path will be “/etc/security/limits.d/$title.conf”

Parameters:

  • content (Variant[Undef,String]) (defaults to: undef)

    Sets the value of content parameter for the target file.

  • source (Variant[Undef,String]) (defaults to: undef)

    Sets the value of source parameter for the target file.

  • template (Variant[Undef,String]) (defaults to: undef)

    Sets the path of the template to use fot content parameter

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

    If to add or remove the limtis file

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

    The path of the target file. Default: “/etc/security/limits.d/$title.conf”

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

    A custom hash of file params to override defaults

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

    Optional hash of custom key pairs which can be used in template



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'manifests/limits/config.pp', line 15

define psick::limits::config (
  Enum['present','absent'] $ensure         = present,
  Variant[Undef,String]    $content        = undef,
  Variant[Undef,String]    $template       = undef,
  Variant[Undef,String]    $source         = undef,
  Optional[String]         $path           = undef,
  Hash                     $file_params    = {},
  Hash                     $options        = {},
) {
  include psick::limits

  $file_path = pick($path,"${psick::limits::limits_dir_path}/${title}.conf")
  $file_params_default = {
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    content => psick::template($template , $options),
    source  => $source,
  }
  file { $file_path:
    * => $file_params_default + $file_params,
  }
}