aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2018-04-12 12:58:52 -0300
committerSilvio Rhatto <rhatto@riseup.net>2018-04-12 12:58:52 -0300
commit4203f911b71ac593b8be3c3a22d36b89dc938767 (patch)
treebf60b6c2cb18c4625995e55e428e4df670e61352
parent5463cc3ce5ad481b6f72cebd20c40af8017848c1 (diff)
downloadpuppet-php-4203f911b71ac593b8be3c3a22d36b89dc938767.tar.gz
puppet-php-4203f911b71ac593b8be3c3a22d36b89dc938767.tar.bz2
Adds apc class
-rw-r--r--manifests/apc.pp20
-rw-r--r--manifests/init.pp2
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,
}