diff --git a/manifests/init.pp b/manifests/init.pp index 30a3e1c..58b6658 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -223,6 +223,9 @@ file { 'php.dir': ensure => directory, path => $php::config_dir, + mode => $php::config_file_mode, + owner => $php::config_file_owner, + group => $php::config_file_group, require => Package['php'], source => $php::source_dir, recurse => true, diff --git a/manifests/module.pp b/manifests/module.pp index 9712ad3..238e9c2 100644 --- a/manifests/module.pp +++ b/manifests/module.pp @@ -45,7 +45,8 @@ $service_autorestart = $php::params::service_autorestart, $service = $php::params::service, $module_prefix = $php::params::module_prefix, - $absent = $php::params::absent + $absent = $php::params::absent, + $module_config_file = $php::params::module_config_file ) { include php @@ -70,4 +71,15 @@ require => Package['php'], } + if !($module_config_file == '' or $absent) { + file { "PhpModule_conf_${name}": + ensure => present, + path => "${php::params::module_config_dir}/${name}.ini", + source => $module_config_file, + owner => $php::params::config_file_owner, + group => $php::params::config_file_group, + mode => $php::params::config_file_mode, + } + } + } diff --git a/manifests/params.pp b/manifests/params.pp index 5c9c2d0..7c1d37e 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -37,6 +37,10 @@ default => '/etc/php.d', } + $module_config_dir = $::operatingsystem ? { + default => "${config_dir}/conf.d", + } + $config_file = $::operatingsystem ? { /(?i:Ubuntu|Debian|Mint)/ => '/etc/php5/php.ini', default => '/etc/php.ini', @@ -76,6 +80,7 @@ $version = 'present' $service_autorestart = true $absent = false + $module_config_file = '' ### General module variables that can have a site or per module default $puppi = false