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