summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-02-07 16:22:11 -0200
committerSilvio Rhatto <rhatto@riseup.net>2010-02-07 16:22:11 -0200
commit13859194594db5744696b5ce03847584f8065285 (patch)
treeb3f793dd3399c7c06afc827890f05788c6c7b674
parentb317e3ac6756034b873a86a3d904535955a8aae6 (diff)
downloadpuppet-apache-13859194594db5744696b5ce03847584f8065285.tar.gz
puppet-apache-13859194594db5744696b5ce03847584f8065285.tar.bz2
Preparing variables before resource definitions
-rw-r--r--manifests/init.pp40
1 files changed, 19 insertions, 21 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index f9c3a81..5ad7b16 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -30,6 +30,25 @@ $apache2_macros = "/etc/apache2/conf.d/macros"
$apache2_conf = "/etc/apache2/apache2.conf"
class apache {
+ case $apache_www_folder {
+ '': { $apache_www_folder = "/var/www" }
+ }
+
+ case $apache_sites_folder {
+ '': { $apache_sites_folder = "${apache_www_folder}/sites" }
+ }
+
+ case $apache_error_folder {
+ '': { $apache_error_folder = "${apache_www_folder}/error" }
+ }
+
+ case $apache_error_dest {
+ '': { $apache_error_dest = "${apache_error_folder}/index.html" }
+ }
+
+ case $apache_server_name {
+ '': { $apache_server_name = $fqdn }
+ }
package { "apache":
name => "apache2",
@@ -75,27 +94,6 @@ class apache {
notify => Service["apache"],
}
- # prepare variables to use in templates
- case $apache_www_folder {
- '': { $apache_www_folder = "/var/www" }
- }
-
- case $apache_sites_folder {
- '': { $apache_sites_folder = "${apache_www_folder}/sites" }
- }
-
- case $apache_error_folder {
- '': { $apache_error_folder = "${apache_www_folder}/error" }
- }
-
- case $apache_error_dest {
- '': { $apache_error_dest = "${apache_error_folder}/index.html" }
- }
-
- case $apache_server_name {
- '': { $apache_server_name = $fqdn }
- }
-
define site($ensure = present, $docroot = false, $redirect = false,
$redirect_match = false, $protocol = 'http',
$server_alias = false, $use = false, $ticket = false,