summaryrefslogtreecommitdiff
path: root/manifests/init.pp
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2008-02-08 14:52:53 +0000
committermh <mh@immerda.ch>2008-02-08 14:52:53 +0000
commit0526a4edb25f5b985cfcd921b6a5cd1e70ee6d3a (patch)
tree466752c266cae2af8a4afdba7560d0c2181fc09f /manifests/init.pp
parentd0c8dd7dc2067279cf5644d5def0de4aac305d3f (diff)
refactored apache class
Diffstat (limited to 'manifests/init.pp')
-rw-r--r--manifests/init.pp71
1 files changed, 35 insertions, 36 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 82baaef..e3a5e00 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -2,44 +2,21 @@
# 2008 - admin(at)immerda.ch
# License: GPLv3
-
class apache {
package { 'apache':
- name => $operatingsystem ? {
- centos => 'httpd',
- default => 'apache'
- },
- category => $operatingsystem ? {
- gentoo => 'www-servers',
- default => '',
- },
- ensure => present,
- }
-
- case $operatingsystem {
- centos: {
- package { 'mod_ssl':
- name => 'mod_ssl',
- ensure => present,
- }
- }
+ name => 'apache'
+ ensure => present,
}
service { apache:
- name => $operatingsystem ? {
- centos => 'httpd',
- default => 'apache2'
- },
+ name => 'apache2'
enable => true,
ensure => running,
require => Package[apache],
}
- file { 'default_index':
- path => $operatingsystem ? {
- centos => '/var/www/html/index.html',
- default => '/var/www/localhost/index.html'
- },
+ file { 'default_apache_index':
+ path => '/var/www/localhost/index.html'
ensure => file,
owner => 'root',
group => 0,
@@ -49,19 +26,41 @@ class apache {
}
case $operatingsystem {
- centos: { include apache_centos }
+ centos: { include apache::centos }
+ gentoo: { include apache::gentoo }
}
}
### distro specific stuff
-class apache_centos {
- file {'/etc/httpd/vhosts.d':
- ensure => directory,
- owner => root,
- group => 0,
- mode => 700,
- }
+class apache::centos {
+ Package[apache]{
+ name => 'httpd',
+ }
+ Service[apache]{
+ name => 'httpd'
+ }
+ package { 'mod_ssl':
+ name => 'mod_ssl',
+ ensure => present,
+ require => Package[apache],
+ }
+
+ File[default_apache_index]{
+ path => '/var/www/html/index.html',
+ }
+
+ file {'/etc/httpd/vhosts.d':
+ ensure => directory,
+ owner => root,
+ group => 0,
+ mode => 750,
+ }
}
+class apache::gentoo {
+ Package[apache]{
+ category => 'www-servers',
+ }
+}