aboutsummaryrefslogtreecommitdiff
path: root/manifests/config.pp
blob: e4d143e8f7ab1b602ef21e2df8cd2ef67b9b695d (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', $param = $name, $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}-${param}.ini":
    ensure  => $ensure,
    owner   => root,
    group   => root,
    mode    => '0644',
    content => "${param}=${value}\n",
    require => File["${folder}/${sapi}/conf.d"],
    notify  => $sapi ? {
      'apache2' => Service['apache2'],
      'fpm'     => Service["php${version}-fpm"],
      default   => undef,
    },
  }
}