Puppet: Set date.timezone for PHP in a separate INI file

This commit is contained in:
Eric Lippmann 2015-07-23 12:40:12 +02:00
parent af6def7d7f
commit b4861fe689
3 changed files with 24 additions and 15 deletions

View File

@ -20,24 +20,11 @@ class php {
package { 'php': package { 'php':
ensure => latest, ensure => latest,
require => Package['apache'],
notify => Service['apache']
}
# TODO(el): Always executed. Should be a resource
-> exec { 'php-timezone':
command => 'sed -re $\'s#^;?(date\\.timezone =).*$#\\1 "UTC"#\' -i /etc/php.ini',
notify => Service['apache'], notify => Service['apache'],
require => Package['apache'],
} }
file { '/etc/php.d/error_reporting.ini': php::phpd { ['error_reporting', 'timezone', 'xdebug_settings' ]:
content => template('php/error_reporting.ini.erb'),
require => Package['php'], require => Package['php'],
notify => Service['apache']
}
file { '/etc/php.d/xdebug_settings.ini':
content => template('php/xdebug_settings.ini.erb'),
require => Package['php'],
notify => Service['apache']
} }
} }

View File

@ -0,0 +1,21 @@
# define: php::phpd
#
# Provision php.d config
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
define php::phpd {
include php
file { "/etc/php.d/$name.ini":
content => template("php/$name.ini.erb"),
notify => Service['apache'],
}
}

View File

@ -0,0 +1 @@
date.timezone = "UTC"