1
2
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
|
# File 'manifests/fpm/opcache.pp', line 1
class php::fpm::opcache (
$ensure = present,
$enable = 0,
$enable_cli = 0,
$memory_consumption = 64,
$interned_strings_buffer = 4,
$max_accelerated_files = 2000,
$max_wasted_percentage = 5,
$use_cwd = 1,
$revalidate_freq = 2,
$revalidate_path = 0,
$save_comments = 1,
$load_comments = 1,
$fast_shutdown = 0,) {
exec { "run_enable_opcache_php_module":
command => "/usr/sbin/php5enmod opcache",
creates => "/etc/php5/fpm/conf.d/05-opcache.ini",
notify => Class["php::fpm::service"],
}
ini_setting { "opcache.enable":
ensure => present,
path => '/etc/php5/fpm/php.ini',
section => 'opcache',
setting => 'opcache.enable',
value => $enable,
require => Package["php5-fpm"],
notify => Class["php::fpm::service"],
}
ini_setting { "opcache.memory_consumption":
ensure => present,
path => '/etc/php5/fpm/php.ini',
section => 'opcache',
setting => 'opcache.memory_consumption',
value => $memory_consumption,
require => Package["php5-fpm"],
notify => Class["php::fpm::service"],
}
ini_setting { "opcache.max_accelerated_files":
ensure => present,
path => '/etc/php5/fpm/php.ini',
section => 'opcache',
setting => 'opcache.max_accelerated_files',
value => $max_accelerated_files,
require => Package["php5-fpm"],
notify => Class["php::fpm::service"],
}
ini_setting { "opcache.revalidate_freq":
ensure => present,
path => '/etc/php5/fpm/php.ini',
section => 'opcache',
setting => 'opcache.revalidate_freq',
value => $revalidate_freq,
require => Package["php5-fpm"],
notify => Class["php::fpm::service"],
}
}
|