]> gitweb.fluxo.info Git - puppet-php.git/commitdiff
Adds php::resources
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 5 Jul 2016 18:52:58 +0000 (15:52 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 5 Jul 2016 18:52:58 +0000 (15:52 -0300)
manifests/config.pp
manifests/init.pp
manifests/resources.pp [new file with mode: 0644]

index 22ae8a86886eaf201b9e96ea1f980b4316c11a6c..83910d4ec088c059538c2b52720052d2859ceff7 100644 (file)
@@ -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,
index 034801f84c54d1755a261b8b09b2f4145068b967..b41399291ea5856bf28d3002dae49debc2e38c69 100644 (file)
@@ -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 (file)
index 0000000..88e173c
--- /dev/null
@@ -0,0 +1,6 @@
+class php::resources {
+  $configs = hiera('php::config', {})
+
+  # Apply instances
+  create_resources('php::config', $configs)
+}