2010-09-01 18:01:04 -04:00
|
|
|
# Class: apache
|
|
|
|
#
|
|
|
|
# This class installs Apache
|
|
|
|
#
|
|
|
|
# Parameters:
|
|
|
|
#
|
|
|
|
# Actions:
|
|
|
|
# - Install Apache
|
|
|
|
# - Manage Apache service
|
|
|
|
#
|
|
|
|
# Requires:
|
|
|
|
#
|
|
|
|
# Sample Usage:
|
|
|
|
#
|
|
|
|
class apache {
|
|
|
|
include apache::params
|
|
|
|
package { 'httpd':
|
|
|
|
name => $apache::params::apache_name,
|
|
|
|
ensure => present,
|
|
|
|
}
|
|
|
|
service { 'httpd':
|
|
|
|
name => $apache::params::apache_name,
|
|
|
|
ensure => running,
|
|
|
|
enable => true,
|
|
|
|
subscribe => Package['httpd'],
|
|
|
|
}
|
2011-07-15 15:23:24 -07:00
|
|
|
|
2010-09-01 18:01:04 -04:00
|
|
|
# May want to purge all none realize modules using the resources resource type.
|
|
|
|
#
|
|
|
|
A2mod { require => Package['httpd'], notify => Service['httpd']}
|
2011-07-15 15:23:24 -07:00
|
|
|
case $operatingsystem {
|
|
|
|
'debian','ubuntu': {
|
|
|
|
@a2mod {
|
|
|
|
'rewrite' : ensure => present;
|
|
|
|
'headers' : ensure => present;
|
|
|
|
'expires' : ensure => present;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default: { }
|
2010-09-01 18:01:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
file { $apache::params::vdir:
|
|
|
|
ensure => directory,
|
|
|
|
recurse => true,
|
|
|
|
purge => true,
|
|
|
|
notify => Service['httpd'],
|
|
|
|
}
|
|
|
|
}
|