diff modules/website/manifests/php.pp @ 0:956e484adc12

Initial public release of Puppet configs
author IBBoard <dev@ibboard.co.uk>
date Sat, 16 Aug 2014 19:47:38 +0000
parents
children ea71652452e9
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/website/manifests/php.pp	Sat Aug 16 19:47:38 2014 +0000
@@ -0,0 +1,26 @@
+class website::php(
+    $suffix = '',
+    $opcache = undef,
+    ) {
+  $packages = [ "php${suffix}", "php${suffix}-mcrypt", "php${suffix}-mbstring", "php${suffix}-xml", "php${suffix}-gd" ]
+  package { $packages:
+    ensure => latest,
+    notify => Service['httpd']
+  }
+  ->
+  file { '/etc/php.d/custom-lockdown.ini':
+    ensure => present,
+    content => 'allow_url_fopen = \'off\'',
+  }
+
+  if $opcache {
+    package { "php${suffix}-${opcache}":
+      ensure => latest,
+      notify => Service['httpd'],
+    }
+    file { '/etc/php.d/opcache.ini':
+      ensure => present,
+      content => 'zend_extension=/usr/lib64/php/modules/opcache.so',
+    }
+  }
+}