From 937b01a94aae91a97d2f17579cb1318adbe71672 Mon Sep 17 00:00:00 2001 From: Peter Hall Date: Mon, 11 Feb 2013 12:24:34 +1100 Subject: [PATCH 1/4] Adding the ability for custom config files for a module --- manifests/module.pp | 12 +++++++++++- manifests/params.pp | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/manifests/module.pp b/manifests/module.pp index 9712ad3..c51f8c4 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,13 @@ require => Package['php'], } + if !($module_config_file == '' or $absent) { + file { "PhpModule_conf_${name}": + ensure => present, + 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..27562f3 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -76,6 +76,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 From 272269aa0cc48e5fef06fcb03df9dfa946fdbe55 Mon Sep 17 00:00:00 2001 From: Peter Hall Date: Mon, 11 Feb 2013 13:32:36 +1100 Subject: [PATCH 2/4] Fixing syntax --- manifests/module.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/module.pp b/manifests/module.pp index c51f8c4..f583daf 100644 --- a/manifests/module.pp +++ b/manifests/module.pp @@ -78,6 +78,7 @@ owner => $php::params::config_file_owner, group => $php::params::config_file_group, mode => $php::params::config_file_mode, + } } } From b7f3998c2083043f5039b6ea0325f7dcf85d4f78 Mon Sep 17 00:00:00 2001 From: Peter Hall Date: Mon, 11 Feb 2013 14:02:58 +1100 Subject: [PATCH 3/4] Fixing path for module config files --- manifests/module.pp | 1 + manifests/params.pp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/manifests/module.pp b/manifests/module.pp index f583daf..238e9c2 100644 --- a/manifests/module.pp +++ b/manifests/module.pp @@ -74,6 +74,7 @@ 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, diff --git a/manifests/params.pp b/manifests/params.pp index 27562f3..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', From 8e0f7360723a71460c7c029cae246c2089d69d5c Mon Sep 17 00:00:00 2001 From: Peter Hall Date: Tue, 12 Feb 2013 11:04:46 +1100 Subject: [PATCH 4/4] Setting the owner, group amd mode of the php5 conf dir to the same as if you used the conf file. --- manifests/init.pp | 3 +++ 1 file changed, 3 insertions(+) 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,