-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapache_define.pp.old
29 lines (27 loc) · 1018 Bytes
/
apache_define.pp.old
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
define apachevhost ($root, $servername){
file { $root:
ensure => 'directory',
}
file { "/etc/httpd/conf/virtual/${servername}.conf":
ensure => 'file',
content => template('apache.erb'),
}
}
class apache {
apachevhost { 'myapp.example.com':
servername => 'myapp.example.com',
root => "/srv/www/html/myapp.example.com"
}
apachevhost { 'myapp1.example.com':
servername => 'myapp1.example.com',
root => "/srv/www/html/myapp1.example.com"
}
apachevhost { 'myapp2.example.com':
servername => 'myapp2.example.com',
root => "/srv/www/html/myapp2.example.com"
}
Apachevhost['myapp.example.com'] ~> Service['httpd']
Apachevhost['myapp1.example.com'] ~> Service['httpd']
Apachevhost['myapp2.example.com'] ~> Service['httpd']
Apachevhost['myapp3.example.com'] ~> Service['httpd']
}