-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpuppet-exam.pp
More file actions
50 lines (36 loc) · 888 Bytes
/
puppet-exam.pp
File metadata and controls
50 lines (36 loc) · 888 Bytes
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
# Paul Gibson - gibson.a.paul@gmail.com
include nginx
include git
# Create web root directory
file { "/var/www/":
ensure => "directory",
mode => 755
}
# Clone git repo to web root
git::repo{'puppetlabs':
path => '/var/www/',
source => 'git://github.com/puppetlabs/exercise-webpage.git',
branch => 'master',
update => true,
}
# Server config variable
$puppet_exam_config = "server {
listen 8000;
server_name localhost;
location / {
root /var/www;
index index.html index.htm;
}
location ~ /\\. { return 403; }
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
"
# Copy server config variable to file
file { "/etc/nginx/conf.d/puppet-exam.conf":
ensure => present,
content => "$puppet_exam_config",
notify => Service["nginx"]
}