From 1b2310bab053cd40616e9740f9d38ef8826b3764 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 14 Nov 2009 14:34:05 +0100 Subject: update apache module to 0.25.x style --- manifests/base.pp | 10 +++++----- manifests/centos.pp | 12 ++++++------ manifests/centos/itk.pp | 4 ++-- manifests/centos/module.pp | 8 ++++---- manifests/config/file.pp | 10 +++++----- manifests/debian.pp | 4 ++-- manifests/gentoo.pp | 6 +++--- manifests/gentoo/module.pp | 8 ++++---- manifests/openbsd.pp | 14 +++++++------- manifests/vhost/file.pp | 28 ++++++++++++++-------------- manifests/vhost/file/documentrootfile.pp | 10 +++++----- 11 files changed, 57 insertions(+), 57 deletions(-) (limited to 'manifests') diff --git a/manifests/base.pp b/manifests/base.pp index 07b95e2..a6953bc 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -1,26 +1,26 @@ class apache::base { file{'vhosts_dir': - path => '/etc/apache2/vhosts.d/', + path => '/etc/apache2/vhosts.d', ensure => directory, owner => root, group => 0, mode => 0755; } file{'config_dir': - path => '/etc/apache2/conf.d/', + path => '/etc/apache2/conf.d', ensure => directory, owner => root, group => 0, mode => 0755; } file{'modules_dir': - path => '/etc/apache2/modules.d/', + path => '/etc/apache2/modules.d', ensure => directory, owner => root, group => 0, mode => 0755; } file{'htpasswd_dir': - path => '/var/www/htpasswds/', + path => '/var/www/htpasswds', ensure => directory, owner => root, group => apache, mode => 0640; } file{'web_dir': - path => '/var/www/', + path => '/var/www', ensure => directory, owner => root, group => 0, mode => 0755; } diff --git a/manifests/centos.pp b/manifests/centos.pp index 4755af8..23c8e3c 100644 --- a/manifests/centos.pp +++ b/manifests/centos.pp @@ -1,6 +1,6 @@ ### centos class apache::centos inherits apache::package { - $config_dir = '/etc/httpd/' + $config_dir = '/etc/httpd' Package[apache]{ name => 'httpd', @@ -10,13 +10,13 @@ class apache::centos inherits apache::package { restart => '/etc/init.d/httpd graceful', } File[vhosts_dir]{ - path => "$config_dir/vhosts.d/", + path => "$config_dir/vhosts.d", } File[config_dir]{ - path => "$config_dir/conf.d/", + path => "$config_dir/conf.d", } File[modules_dir]{ - path => "$config_dir/modules.d/", + path => "$config_dir/modules.d", } File[web_dir]{ path => "/var/www/vhosts", @@ -26,8 +26,8 @@ class apache::centos inherits apache::package { } file{'/etc/sysconfig/httpd': - source => [ "puppet://$server/files/apache/sysconfig/${fqdn}/httpd", - "puppet://$server/files/apache/sysconfig/httpd", + source => [ "puppet://$server/modules/site-apache/sysconfig/${fqdn}/httpd", + "puppet://$server/modules/site-apache/sysconfig/httpd", "puppet://$server/modules/apache/sysconfig/${operatingsystem}/httpd", "puppet://$server/modules/apache/sysconfig/httpd" ], require => Package['apache'], diff --git a/manifests/centos/itk.pp b/manifests/centos/itk.pp index f944a53..98939c2 100644 --- a/manifests/centos/itk.pp +++ b/manifests/centos/itk.pp @@ -5,8 +5,8 @@ class apache::centos::itk inherits apache::centos { name => 'httpd-itk', } File['/etc/sysconfig/httpd']{ - source => [ "puppet://$server/files/apache/sysconfig/${fqdn}/httpd.itk", - "puppet://$server/files/apache/sysconfig/httpd.itk", + source => [ "puppet://$server/modules/site-apache/sysconfig/${fqdn}/httpd.itk", + "puppet://$server/modules/site-apache/sysconfig/httpd.itk", "puppet://$server/modules/apache/sysconfig/${operatingsystem}/httpd.itk", "puppet://$server/modules/apache/sysconfig/httpd.itk" ], } diff --git a/manifests/centos/module.pp b/manifests/centos/module.pp index b5b0d08..4bbf251 100644 --- a/manifests/centos/module.pp +++ b/manifests/centos/module.pp @@ -3,16 +3,16 @@ define apache::centos::module( $source = '', $destination = '' ){ - $modules_dir = "$apache::centos::config_dir/modules.d/" + $modules_dir = "$apache::centos::config_dir/modules.d" $real_destination = $destination ? { '' => "${modules_dir}/${name}.so", default => $destination, } $real_source = $source ? { '' => [ - "puppet://$server/files/apache/modules.d/${fqdn}/${name}.so", - "puppet://$server/files/apache/modules.d/${apache_cluster_node}/${name}.so", - "puppet://$server/files/apache/modules.d/${name}.so", + "puppet://$server/modules/site-apache/modules.d/${fqdn}/${name}.so", + "puppet://$server/modules/site-apache/modules.d/${apache_cluster_node}/${name}.so", + "puppet://$server/modules/site-apache/modules.d/${name}.so", "puppet://$server/modules/apache/modules.d/${operatingsystem}/${name}.so", "puppet://$server/modules/apache/modules.d/${name}.so" ], diff --git a/manifests/config/file.pp b/manifests/config/file.pp index d14cd36..a72aacf 100644 --- a/manifests/config/file.pp +++ b/manifests/config/file.pp @@ -26,11 +26,11 @@ define apache::config::file( 'absent': { $real_source = $source ? { 'absent' => [ - "puppet://$server/files/apache/conf.d/${fqdn}/${name}", - "puppet://$server/files/apache/conf.d/${apache_cluster_node}/${name}", - "puppet://$server/files/apache/conf.d/${operatingsystem}.${lsbdistcodename}/${name}", - "puppet://$server/files/apache/conf.d/${operatingsystem}/${name}", - "puppet://$server/files/apache/conf.d/${name}", + "puppet://$server/modules/site-apache/conf.d/${fqdn}/${name}", + "puppet://$server/modules/site-apache/conf.d/${apache_cluster_node}/${name}", + "puppet://$server/modules/site-apache/conf.d/${operatingsystem}.${lsbdistcodename}/${name}", + "puppet://$server/modules/site-apache/conf.d/${operatingsystem}/${name}", + "puppet://$server/modules/site-apache/conf.d/${name}", "puppet://$server/modules/apache/conf.d/${operatingsystem}.${lsbdistcodename}/${name}", "puppet://$server/modules/apache/conf.d/${operatingsystem}/${name}", "puppet://$server/modules/apache/conf.d/${name}" diff --git a/manifests/debian.pp b/manifests/debian.pp index 3ea0002..8733a91 100644 --- a/manifests/debian.pp +++ b/manifests/debian.pp @@ -1,9 +1,9 @@ ### debian class apache::debian inherits apache::package { - $config_dir = '/etc/apache2/' + $config_dir = '/etc/apache2' file {"$vhosts_dir": - ensure => '/etc/apache2/sites-enabled/', + ensure => "${config_dir}/sites-enabled", } File[default_apache_index] { path => '/var/www/index.html', diff --git a/manifests/gentoo.pp b/manifests/gentoo.pp index 10839f0..46ad8cb 100644 --- a/manifests/gentoo.pp +++ b/manifests/gentoo.pp @@ -1,6 +1,6 @@ ### gentoo class apache::gentoo inherits apache::package { - $config_dir = '/etc/apache2/' + $config_dir = '/etc/apache2' # needs module gentoo gentoo::etcconfd { @@ -11,10 +11,10 @@ class apache::gentoo inherits apache::package { category => 'www-servers', } File[vhosts_dir]{ - path => "$config_dir/vhosts.d/", + path => "$config_dir/vhosts.d", } File[modules_dir]{ - path => "$config_dir/modules.d/", + path => "$config_dir/modules.d", } apache::gentoo::module { '00_default_settings': } diff --git a/manifests/gentoo/module.pp b/manifests/gentoo/module.pp index ce9656a..7764c6f 100644 --- a/manifests/gentoo/module.pp +++ b/manifests/gentoo/module.pp @@ -3,16 +3,16 @@ define apache::gentoo::module( $source = '', $destination = '' ){ - $modules_dir = "$apache::gentoo::config_dir/modules.d/" + $modules_dir = "$apache::gentoo::config_dir/modules.d" $real_destination = $destination ? { '' => "${modules_dir}/${name}.conf", default => $destination, } $real_source = $source ? { '' => [ - "puppet://$server/files/apache/modules.d/${fqdn}/${name}.conf", - "puppet://$server/files/apache/modules.d/${apache_cluster_node}/${name}.conf", - "puppet://$server/files/apache/modules.d/${name}.conf", + "puppet://$server/modules/site-apache/modules.d/${fqdn}/${name}.conf", + "puppet://$server/modules/site-apache/modules.d/${apache_cluster_node}/${name}.conf", + "puppet://$server/modules/site-apache/modules.d/${name}.conf", "puppet://$server/modules/apache/modules.d/${operatingsystem}/${name}.conf", "puppet://$server/modules/apache/modules.d/${name}.conf" ], diff --git a/manifests/openbsd.pp b/manifests/openbsd.pp index 005090d..606bdc6 100644 --- a/manifests/openbsd.pp +++ b/manifests/openbsd.pp @@ -1,15 +1,15 @@ ### openbsd class apache::openbsd inherits apache::base { - $config_dir = '/var/www/' + $config_dir = '/var/www' File[vhosts_dir]{ - path => "$config_dir/vhosts.d/", + path => "$config_dir/vhosts.d", } File[modules_dir]{ - path => "$config_dir/conf/modules/", + path => "$config_dir/conf/modules", } File[config_dir]{ - path => "$config_dir/conf.d/", + path => "$config_dir/conf.d", } File['htpasswd_dir']{ group => www, @@ -22,9 +22,9 @@ class apache::openbsd inherits apache::base { line => 'httpd flags=""', } file{"$config_dir/conf/httpd.conf": - source => [ "puppet://$server/files/apache/conf/${fqdn}/httpd.conf", - "puppet://$server/files/apache/conf/${apache_cluster_node}/httpd.conf", - "puppet://$server/files/apache/conf/httpd.conf", + source => [ "puppet://$server/modules/site-apache/conf/${fqdn}/httpd.conf", + "puppet://$server/modules/site-apache/conf/${apache_cluster_node}/httpd.conf", + "puppet://$server/modules/site-apache/conf/httpd.conf", "puppet://$server/modules/apache/conf/${operatingsystem}/httpd.conf", "puppet://$server/modules/apache/conf/httpd.conf" ], notify => Service['apache'], diff --git a/manifests/vhost/file.pp b/manifests/vhost/file.pp index cdc0599..caa649d 100644 --- a/manifests/vhost/file.pp +++ b/manifests/vhost/file.pp @@ -18,12 +18,12 @@ define apache::vhost::file( $use_mod_macro = false ){ $vhosts_dir = $operatingsystem ? { - centos => "$apache::centos::config_dir/vhosts.d/", - gentoo => "$apache::gentoo::config_dir/vhosts.d/", - debian => "$apache::debian::config_dir/vhosts.d/", - ubuntu => "$apache::ubuntu::config_dir/vhosts.d/", - openbsd => "$apache::openbsd::config_dir/vhosts.d/", - default => '/etc/apache2/vhosts.d/', + centos => "$apache::centos::config_dir/vhosts.d", + gentoo => "$apache::gentoo::config_dir/vhosts.d", + debian => "$apache::debian::config_dir/vhosts.d", + ubuntu => "$apache::ubuntu::config_dir/vhosts.d", + openbsd => "$apache::openbsd::config_dir/vhosts.d", + default => '/etc/apache2/vhosts.d', } $real_vhost_destination = $vhost_destination ? { 'absent' => "$vhosts_dir/$name.conf", @@ -46,11 +46,11 @@ define apache::vhost::file( 'absent': { $real_vhost_source = $vhost_source ? { 'absent' => [ - "puppet://$server/files/apache/vhosts.d/$fqdn/$name.conf", - "puppet://$server/files/apache/vhosts.d/$apache_cluster_node/$name.conf", - "puppet://$server/files/apache/vhosts.d/$operatingsystem.$lsbdistcodename/$name.conf", - "puppet://$server/files/apache/vhosts.d/$operatingsystem/$name.conf", - "puppet://$server/files/apache/vhosts.d/$name.conf", + "puppet://$server/modules/site-apache/vhosts.d/$fqdn/$name.conf", + "puppet://$server/modules/site-apache/vhosts.d/$apache_cluster_node/$name.conf", + "puppet://$server/modules/site-apache/vhosts.d/$operatingsystem.$lsbdistcodename/$name.conf", + "puppet://$server/modules/site-apache/vhosts.d/$operatingsystem/$name.conf", + "puppet://$server/modules/site-apache/vhosts.d/$name.conf", "puppet://$server/modules/apache/vhosts.d/$name.conf", "puppet://$server/modules/apache/vhosts.d/$operatingsystem.$lsbdistcodename/$name.conf", "puppet://$server/modules/apache/vhosts.d/$operatingsystem/$name.conf", @@ -78,9 +78,9 @@ define apache::vhost::file( } file{$real_htpasswd_path: ensure => $ensure, - source => [ "puppet://$server/files/apache/htpasswds/$fqdn/$name", - "puppet://$server/files/apache/htpasswds/$apache_cluster_node/$name", - "puppet://$server/files/apache/htpasswds/$name" ], + source => [ "puppet://$server/modules/site-apache/htpasswds/$fqdn/$name", + "puppet://$server/modules/site-apache/htpasswds/$apache_cluster_node/$name", + "puppet://$server/modules/site-apache/htpasswds/$name" ], owner => root, group => 0, mode => 0644; } } diff --git a/manifests/vhost/file/documentrootfile.pp b/manifests/vhost/file/documentrootfile.pp index 89ca4ac..441d605 100644 --- a/manifests/vhost/file/documentrootfile.pp +++ b/manifests/vhost/file/documentrootfile.pp @@ -7,11 +7,11 @@ define apache::vhost::file::documentrootfile( $mode=440 ){ file{"$documentroot/$filename": - source => [ "puppet://$server/files/apache/vhost_varieties/$fqdn/$thedomain/$filename", - "puppet://$server/files/apache/vhost_varieties/$apache_cluster_node/$thedomain/$filename", - "puppet://$server/files/apache/vhost_varieties/$operatingsystem.$lsbdistcodename/$thedomain/$filename", - "puppet://$server/files/apache/vhost_varieties/$operatingsystem/$thedomain/$filename", - "puppet://$server/files/apache/vhost_varieties/$thedomain/$filename", + source => [ "puppet://$server/modules/site-apache/vhost_varieties/$fqdn/$thedomain/$filename", + "puppet://$server/modules/site-apache/vhost_varieties/$apache_cluster_node/$thedomain/$filename", + "puppet://$server/modules/site-apache/vhost_varieties/$operatingsystem.$lsbdistcodename/$thedomain/$filename", + "puppet://$server/modules/site-apache/vhost_varieties/$operatingsystem/$thedomain/$filename", + "puppet://$server/modules/site-apache/vhost_varieties/$thedomain/$filename", "puppet://$server/modules/apache/vhost_varieties/$thedomain/$filename", "puppet://$server/modules/apache/vhost_varieties/$operatingsystem.$lsbdistcodename/$thedomain/$filename", "puppet://$server/modules/apache/vhost_varieties/$operatingsystem/$thedomain/$filename", -- cgit v1.2.3