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, }, } }