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
|
# File 'manifests/limits.pp', line 31
class pam::limits (
Stdlib::Absolutepath $config_file = '/etc/security/limits.conf',
Optional[Array] $config_file_lines = undef,
Optional[String] $config_file_source = undef,
Stdlib::Filemode $config_file_mode = '0640',
Stdlib::Absolutepath $limits_d_dir = '/etc/security/limits.d',
Stdlib::Filemode $limits_d_dir_mode = '0750',
Boolean $purge_limits_d_dir = false,
Optional[Variant[String[1], Array[String[1]]]] $purge_limits_d_dir_ignore = undef,
) {
include pam
if $config_file_lines or $config_file_source {
# config_file_lines takes priority over config_file_source
if $config_file_lines {
$config_file_source_real = undef
$content = template('pam/limits.conf.erb')
} else {
$content = undef
$config_file_source_real = $config_file_source
}
} else {
$content = template('pam/limits.conf.erb')
$config_file_source_real = undef
}
if $facts['os']['family'] == 'Suse' and $facts['os']['release']['major'] == '10' {
# do nothing
} else {
exec { "mkdir_p-${limits_d_dir}":
command => "mkdir -p ${limits_d_dir}",
unless => "test -d ${limits_d_dir}",
path => '/bin:/usr/bin',
}
file { 'limits_d':
ensure => directory,
path => $limits_d_dir,
owner => 'root',
group => 'root',
mode => $limits_d_dir_mode,
purge => $purge_limits_d_dir,
recurse => $purge_limits_d_dir,
ignore => $purge_limits_d_dir_ignore,
require => [
Package[$pam::package_name],
Exec["mkdir_p-${limits_d_dir}"],
],
}
}
file { 'limits_conf':
ensure => file,
path => $config_file,
source => $config_file_source_real,
content => $content,
owner => 'root',
group => 'root',
mode => $config_file_mode,
require => Package[$pam::package_name],
}
}
|