aboutsummaryrefslogtreecommitdiff
path: root/manifests/config.pp
blob: ca307e34b8ec1a26b108bb7147f211b596fbb3da (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
define php::config($series = '5', $order = '20', $value, $ensure = 'present', $sapi = 'apache2') {
  if $series == '5' {
    $version = $::php::series5::version
    $folder  = $::php::series5::folder
  }
  else {
    $version = $::php::series7::version
    $folder  = $::php::series7::folder
  }

  file { "${folder}/${sapi}/conf.d/${order}-${name}.ini":
    ensure  => $ensure,
    owner   => root,
    group   => root,
    mode    => '0644',
    content => "${name}=${value}\n",
    require => File["${folder}/${sapi}/conf.d"],
    notify  => $sapi ? {
      'apache2' => Service['apache2'],
      'fpm'     => Service["php${version}-fpm"],
      default   => undef,
    },
  }
}