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
|
# File 'manifests/shmlog.pp', line 14
class varnish::shmlog (
Stdlib::Absolutepath $shmlog_dir = '/var/lib/varnish',
Boolean $tempfs = true,
String $size = '170M',
) {
file { 'shmlog-dir':
ensure => directory,
path => $shmlog_dir,
seltype => 'varnishd_var_lib_t',
}
# mount shared memory log dir as tmpfs
$shmlog_share_state = $tempfs ? {
true => mounted,
default => absent,
}
$options = $facts['os']['selinux']['enabled'] ? {
true => "defaults,noatime,size=${size},rootcontext=system_u:object_r:varnishd_var_lib_t:s0",
default => "defaults,noatime,size=${size}",
}
mount { 'shmlog-mount':
ensure => $shmlog_share_state,
name => $shmlog_dir,
target => '/etc/fstab',
fstype => 'tmpfs',
device => 'tmpfs',
options => $options,
pass => '0',
dump => '0',
require => File['shmlog-dir'],
}
}
|