define php::fpm( $series, $ensure = 'present', ) { if $series == '5' { $version = $::php::params::version5 $folder = $::php::series5::folder } elsif $series == '7' { $version = $::php::params::version7 $folder = $::php::series7::folder } else { $version = $::php::params::version8 $folder = $::php::series8::folder } package { "php${version}-fpm": ensure => $ensure, } if $ensure == 'present' { service { "php${version}-fpm": ensure => running, require => Package["php${version}-fpm"], } } #$::php::params::version7_previous.each |$item| { # package { "php${item}-fpm": # ensure => absent, # } #} #apache::module { [ "proxy_fcgi", "setenvif" ]: # #ensure => $ensure, # ensure => present, # require => Package["apache"], #} file { [ "${folder}/fpm", "${folder}/fpm/conf.d" ]: ensure => $ensure ? { 'present' => directory, default => undef, }, require => Package["php${version}-fpm"], } }