2013-05-29 17:36:53 +02:00
|
|
|
# Class: apache
|
|
|
|
#
|
|
|
|
# This class installs the apache server.
|
|
|
|
#
|
|
|
|
# Parameters:
|
|
|
|
#
|
|
|
|
# Actions:
|
|
|
|
#
|
|
|
|
# Requires:
|
|
|
|
#
|
|
|
|
# Sample Usage:
|
|
|
|
#
|
|
|
|
# include apache
|
|
|
|
#
|
|
|
|
class apache {
|
|
|
|
$apache = $::operatingsystem ? {
|
|
|
|
/(Debian|Ubuntu)/ => 'apache2',
|
2014-08-18 11:00:30 +02:00
|
|
|
/(RedHat|CentOS|Fedora)/ => 'httpd'
|
2013-05-29 17:36:53 +02:00
|
|
|
}
|
|
|
|
|
2014-09-10 11:38:10 +02:00
|
|
|
$user = $::operatingsystem ? {
|
|
|
|
/(Debian|Ubuntu)/ => 'www-data',
|
|
|
|
/(RedHat|CentOS|Fedora)/ => 'apache'
|
|
|
|
}
|
|
|
|
|
2013-05-29 17:36:53 +02:00
|
|
|
package { $apache:
|
2014-11-24 14:42:07 +01:00
|
|
|
ensure => latest,
|
2014-09-10 11:38:10 +02:00
|
|
|
alias => 'apache',
|
2013-05-29 17:36:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
service { $apache:
|
|
|
|
ensure => running,
|
2014-09-30 12:04:48 +02:00
|
|
|
enable => true,
|
2013-06-03 17:54:44 +02:00
|
|
|
alias => 'apache',
|
2014-09-10 11:38:10 +02:00
|
|
|
require => Package['apache'],
|
|
|
|
}
|
|
|
|
|
2016-02-26 12:33:10 +01:00
|
|
|
package { 'mod_ssl':
|
|
|
|
ensure => latest,
|
|
|
|
notify => Service[$apache],
|
|
|
|
}
|
|
|
|
|
2014-12-10 15:11:57 +01:00
|
|
|
@user { $user:
|
2014-09-10 11:38:10 +02:00
|
|
|
alias => 'apache',
|
2013-05-29 17:36:53 +02:00
|
|
|
}
|
2014-12-10 15:11:57 +01:00
|
|
|
|
|
|
|
User <| alias == apache |>
|
2013-05-29 17:36:53 +02:00
|
|
|
}
|