view modules/website/manifests/php.pp @ 149:af30a5eb468f puppet-3.6

Remove now deprecated mcrypt extension - all scripts now use openssl
author IBBoard <dev@ibboard.co.uk>
date Sun, 26 Mar 2017 16:53:34 +0100
parents 0dd899a10ee1
children 4efaba4fbe94
line wrap: on
line source

class website::php(
    $suffix = '',
    $opcache = undef,
    $extras = [],
    ) {
  File {
      notify => Service['httpd'],
      tag => 'website',
  }
  Package {
      notify => Service['httpd'],
      tag => 'website',
  }
  Package <| tag == 'website' |> -> File <| tag == 'website' |>
  define website::php::extra_php ($pkg = $title) {
    package { "php${website::php::suffix}-${pkg}":
      ensure => installed,
    }
  }

  website::php::extra_php { $extras: }

  $packages = [ "php${suffix}", "php${suffix}-mbstring", "php${suffix}-xml", "php${suffix}-gd" ]
  package { $packages:
    ensure => installed,
  }
  file { '/etc/php.d/custom-lockdown.ini':
    ensure => present,
    content => 'allow_url_fopen = \'off\'
    expose_php = Off',
  }
  file { '/etc/php.d/custom-php.ini':
    ensure => present,
    source => 'puppet:///modules/website/custom-php.ini',
  }

  if $opcache {
    package { "php${suffix}-${opcache}":
      ensure => installed,
      notify => Service['httpd'],
      require => Package["php${suffix}"],
    }
    file { '/etc/php.d/opcache.ini':
      ensure => present,
      content => 'zend_extension=/usr/lib64/php/modules/opcache.so
opcache.memory_consumption=64',
    }
  }
}