aboutsummaryrefslogtreecommitdiff
path: root/manifests/apc.pp
blob: 70b17ebec9d91a5ca240a08e02e06dbc282ce2df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class php::apc(
  $ensure = 'present',
) {
  $fpm                = $::php::fpm
  $version5           = $::php::params::version5
  $version7           = $::php::params::version7
  $series             = $::php::series
  $services_version_5 = regsubst($series,             '^5$', $version5)
  $services_version_7 = regsubst($services_version_5, '^7$', $version7)
  $services_name      = regsubst($services_version_7, '^',   'php')
  $services           = regsubst($services_name,      '$',   '-fpm')

  package { [ 'php-apcu', 'php-apcu-bc' ]:
    ensure => $ensure,
    notify => $fpm ? {
      'present' => Service[$services],
      default   => undef,
    },
  }
}