aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifests/config.pp1
-rw-r--r--manifests/init.pp4
-rw-r--r--manifests/resources.pp6
3 files changed, 10 insertions, 1 deletions
diff --git a/manifests/config.pp b/manifests/config.pp
index 22ae8a8..83910d4 100644
--- a/manifests/config.pp
+++ b/manifests/config.pp
@@ -5,6 +5,7 @@ define php::config($key, $value, $ensure = 'present', $sapi = '') {
group => root,
mode => 0644,
content => "${key}=${value}\n",
+ require => File["${::php::folder}/${sapi}"],
notify => $sapi ? {
'apache2' => Service['apache2'],
default => undef,
diff --git a/manifests/init.pp b/manifests/init.pp
index 034801f..b413992 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -62,6 +62,8 @@ class php {
"puppet:///modules/php/apache2/php.${::operatingsystem}.ini",
"puppet:///modules/php/apache2/php.ini" ],
notify => Service['apache2'],
- require => [ Package['php5'], File["${folder}/etc/php5/apache2'] ],
+ require => [ Package['php5'], File["${folder}/etc/php5/apache2"] ],
}
+
+ include php::resources
}
diff --git a/manifests/resources.pp b/manifests/resources.pp
new file mode 100644
index 0000000..88e173c
--- /dev/null
+++ b/manifests/resources.pp
@@ -0,0 +1,6 @@
+class php::resources {
+ $configs = hiera('php::config', {})
+
+ # Apply instances
+ create_resources('php::config', $configs)
+}