-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathinit.pp
67 lines (63 loc) · 1.41 KB
/
init.pp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Class: apache
#
# This class installs Apache
#
# Parameters:
#
# Actions:
# - Install Apache
# - Manage Apache service
#
# Requires:
#
# Sample Usage:
#
class apache (
$default_mods = true,
$serveradmin = 'root@localhost'
) {
include apache::params
package { 'httpd':
ensure => installed,
name => $apache::params::apache_name,
}
service { 'httpd':
ensure => running,
name => $apache::params::apache_name,
enable => true,
subscribe => Package['httpd'],
}
file { 'httpd_vdir':
ensure => directory,
path => $apache::params::vdir,
recurse => true,
purge => true,
notify => Service['httpd'],
require => Package['httpd'],
}
if $apache::params::conf_dir and $apache::params::conf_file {
# Template uses:
# - $apache::params::user
# - $apache::params::group
# - $apache::params::conf_dir
# - $serveradmin
file { "${apache::params::conf_dir}/${apache::params::conf_file}":
ensure => present,
content => template("apache/${apache::params::conf_file}.erb"),
notify => Service['httpd'],
require => Package['httpd'],
}
if $default_mods == true {
include apache::mod::default
}
}
if $apache::params::mod_dir {
file { $apache::params::mod_dir:
ensure => directory,
require => Package['httpd'],
} -> A2mod <| |>
resources { 'a2mod':
purge => true,
}
}
}