Defined Type: php::ini
- Defined in:
- manifests/ini.pp
Overview
Define: php::ini
With this you can alter/add a php ini file for a specific sapi target or for both cli and apache2 (default for Ubuntu|Debian|Mint|SLES|OpenSuSE)
Parameters
- value
-
String. Optional. Default: ” The value to be added to the ini file
- template
-
String. Optional. Default: ‘extra-ini.erb’ Template to use
- target
-
String. Optional. Default: ‘extra.ini’ The configuration filename
- sapi_target
-
String. Optional. Default: ‘all’ The target sapi for the configuration file. Bu default it will try to apply the configuration to both cli and http
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'manifests/ini.pp', line 24
define php::ini (
$value = '',
$template = 'php/extra-ini.erb',
$target = 'extra.ini',
$sapi_target = 'all',
$service = $php::service,
$config_dir = $php::config_dir,
$package = $php::package
) {
include php
$http_sapi = $::operatingsystem ? {
/(?i:Ubuntu|Debian|Mint|SLES|OpenSuSE)/ => '/apache2/',
default => '/',
}
if ($sapi_target == 'all') {
file { "${config_dir}${http_sapi}conf.d/${target}":
ensure => 'present',
content => template($template),
require => Package[$package],
before => File["${config_dir}/cli/conf.d/${target}"],
}
file { "${config_dir}/cli/conf.d/${target}":
ensure => 'present',
content => template($template),
require => Package[$package],
notify => Service[$service],
}
}else{
file { "${config_dir}/${sapi_target}/conf.d/${target}":
ensure => 'present',
content => template($template),
require => Package[$package],
notify => Service[$service],
}
}
}
|