]> gitweb.fluxo.info Git - puppet-php.git/commitdiff
Adds apc class
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 12 Apr 2018 15:58:52 +0000 (12:58 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 12 Apr 2018 15:58:52 +0000 (12:58 -0300)
manifests/apc.pp [new file with mode: 0644]
manifests/init.pp

diff --git a/manifests/apc.pp b/manifests/apc.pp
new file mode 100644 (file)
index 0000000..634f544
--- /dev/null
@@ -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,
+    },
+  }
+}
index 39d07e8ce02506032a24388396eaf55b0577fded..c0d42a1fe999e9e3e23ad04f46faa92e5704f549 100644 (file)
@@ -26,7 +26,7 @@ class php(
     hardened => $hardened,
   }
 
-  package { [ 'php-apcu', 'php-apcu-bc' ]:
+  class { 'php::apc':
     ensure => $apc,
   }