aboutsummaryrefslogtreecommitdiff
path: root/manifests/fpm.pp
blob: 9b12b93c3c5a9dae754a1b9a3411e248d65d602a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
define php::fpm(
  $series,
  $ensure = 'present',
) {
  if $series == '5' {
    $version = $::php::params::version5
    $folder  = $::php::series5::folder
  }
  else {
    $version = $::php::params::version7
    $folder  = $::php::series7::folder
  }

  package { "php${version}-fpm":
    ensure => $ensure,
  }

  if $ensure == 'present' {
    service { "php${version}-fpm":
      ensure  => running,
      require => Package["php${version}-fpm"],
    }
  }

  #apache::module { [ "proxy_fcgi", "setenvif" ]:
  #  #ensure  => $ensure,
  #  ensure  => present,
  #  require => Package["apache"],
  #}

  file { "${folder}/fpm/conf.d":
    ensure => $ensure ? {
      'present' => present,
      default   => undef,
    },
    require => Package["php${version}-fpm"],
  }
}