diff options
-rw-r--r-- | manifests/apc.pp | 20 | ||||
-rw-r--r-- | manifests/init.pp | 2 |
2 files changed, 21 insertions, 1 deletions
diff --git a/manifests/apc.pp b/manifests/apc.pp new file mode 100644 index 0000000..634f544 --- /dev/null +++ b/manifests/apc.pp @@ -0,0 +1,20 @@ +class php::apc( + $ensure = 'present', +) { + $fpm = $::php::fpm + + if $series == '5' { + $version = $::php::series5::version + } + else { + $version = $::php::series7::version + } + + package { [ 'php-apcu', 'php-apcu-bc' ]: + ensure => $ensure, + notify => $fpm ? { + 'present' => Service["php${version}-fpm"], + default => undef, + }, + } +} diff --git a/manifests/init.pp b/manifests/init.pp index 39d07e8..c0d42a1 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -26,7 +26,7 @@ class php( hardened => $hardened, } - package { [ 'php-apcu', 'php-apcu-bc' ]: + class { 'php::apc': ensure => $apc, } |