annotate modules/website/manifests/http.pp @ 277:13825cc1ec57

Replace deprecated validation methods Puppet now supports data types
author IBBoard <dev@ibboard.co.uk>
date Sun, 26 Jan 2020 12:08:03 +0000
parents 1df1e161bbb5
children af7df930a670
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12
72466547cc79 Update HTTP website manifest so that it works, since we're now hosting a HTTP site
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
1 define website::http(
72466547cc79 Update HTTP website manifest so that it works, since we're now hosting a HTTP site
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
2 $docroot = undef,
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
3 $docroot_owner = 'root',
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
4 $docroot_group = 'root',
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
5 $serveraliases = [],
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6 $ensure = 'present',
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
7 $custom_fragment = undef
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
8 ) {
12
72466547cc79 Update HTTP website manifest so that it works, since we're now hosting a HTTP site
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
9 if ! defined(Class['website']) {
72466547cc79 Update HTTP website manifest so that it works, since we're now hosting a HTTP site
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
10 fail('You must include the website base class before using any website defined resources')
72466547cc79 Update HTTP website manifest so that it works, since we're now hosting a HTTP site
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
11 }
72466547cc79 Update HTTP website manifest so that it works, since we're now hosting a HTTP site
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
12
72466547cc79 Update HTTP website manifest so that it works, since we're now hosting a HTTP site
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
13 $shortname = domain_to_short_name($name)
72466547cc79 Update HTTP website manifest so that it works, since we're now hosting a HTTP site
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
14 $logpart = $shortname
72466547cc79 Update HTTP website manifest so that it works, since we're now hosting a HTTP site
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
15
72466547cc79 Update HTTP website manifest so that it works, since we're now hosting a HTTP site
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
16 if $docroot == undef {
72466547cc79 Update HTTP website manifest so that it works, since we're now hosting a HTTP site
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
17 $siteroot = "${website::basedir}/${shortname}"
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
18 } else {
12
72466547cc79 Update HTTP website manifest so that it works, since we're now hosting a HTTP site
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
19 $siteroot = $docroot
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
20 }
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
21
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
22 apache::vhost { $name:
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
23 port => '80',
12
72466547cc79 Update HTTP website manifest so that it works, since we're now hosting a HTTP site
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
24 docroot => $siteroot,
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
25 docroot_owner => $docroot_owner,
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
26 docroot_group => $docroot_group,
182
1df1e161bbb5 Set group sticky bit on all sites to ease collaboration
IBBoard <dev@ibboard.co.uk>
parents: 161
diff changeset
27 docroot_mode => '2775',
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
28 custom_fragment => $custom_fragment,
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
29 logroot => '/var/log/apache/',
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
30 access_log_file => "access_${logpart}.log",
161
d2b4750e843a Add custom log format - combined plus requested domain
IBBoard <dev@ibboard.co.uk>
parents: 12
diff changeset
31 access_log_format => "%h %l %u %t \\\"%r\\\" %>s %b \\\"%{Referer}i\\\" \\\"%{User-agent}i\\\" %{Host}i",
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
32 serveraliases => $serveraliases,
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
33 ensure => $ensure,
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
34 }
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
35 }