diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2016-07-05 15:52:58 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2016-07-05 15:52:58 -0300 |
commit | 5b21d439e952292a46cf9e659bf8ea6c50de2030 (patch) | |
tree | 29e709158863dde1b659c0801212ff0bb0cbe461 | |
parent | e698d8d2ac0dd59d326e535a331a54360a7d5228 (diff) | |
download | puppet-php-5b21d439e952292a46cf9e659bf8ea6c50de2030.tar.gz puppet-php-5b21d439e952292a46cf9e659bf8ea6c50de2030.tar.bz2 |
Adds php::resources
-rw-r--r-- | manifests/config.pp | 1 | ||||
-rw-r--r-- | manifests/init.pp | 4 | ||||
-rw-r--r-- | manifests/resources.pp | 6 |
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) +} |