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

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