comparison modules/website/manifests/https/multitld.pp @ 0:956e484adc12

Initial public release of Puppet configs
author IBBoard <dev@ibboard.co.uk>
date Sat, 16 Aug 2014 19:47:38 +0000
parents
children 4b42f65ae875
comparison
equal deleted inserted replaced
-1:000000000000 0:956e484adc12
1 define website::https::multitld (
2 $docroot = undef,
3 $ip = $website::primary_ip,
4 $priority = undef,
5 $base = $name,
6 $main_tld = $website::tld,
7 $extra_tlds = $website::extra_tlds,
8 $ssl_ca_chain = undef,
9 $docroot_owner = undef,
10 $docroot_group = undef,
11 $custom_fragment = undef,
12 $force_no_index = undef,
13 $force_no_www = undef,
14 ) {
15
16 if ! defined(Class['website']) {
17 fail('You must include the website base class before using any website defined resources')
18 }
19
20 validate_array($extra_tlds)
21 validate_re($main_tld, '^[a-z]+(\.[a-z]+)?', 'TLD must be in the form "com" or "co.uk"')
22 $alias = domain_to_short_domain($base)
23
24 if $base == $alias {
25 $main_alias = []
26 } else {
27 $main_alias = [ "${alias}.${main_tld}" ]
28 }
29 $main_domain = "${base}.${main_tld}"
30 website::https { $main_domain:
31 priority => $priority,
32 ip => $ip,
33 serveraliases => $main_alias,
34 docroot => $docroot,
35 docroot_owner => $docroot_owner,
36 docroot_group => $docroot_group,
37 ssl_ca_chain => $ssl_ca_chain,
38 custom_fragment => $custom_fragment,
39 force_no_index => $force_no_index,
40 force_no_www => $force_no_www,
41 }
42
43 if count($extra_tlds) > 0 {
44 $base_extras = prefix($extra_tlds, "${base}.")
45
46 website::https::multitldredir { $base_extras:
47 ip => $ip,
48 main_domain => $main_domain,
49 docroot => $docroot,
50 docroot_owner => $docroot_owner,
51 docroot_group => $docroot_group,
52 }
53 }
54 }