]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/apache/tests/vhosts_without_listen.pp
add Openstack modules to 3rdparty
[dsa-puppet.git] / 3rdparty / modules / apache / tests / vhosts_without_listen.pp
1 ## Declare ip-based and name-based vhosts
2 # Mixing Name-based vhost with IP-specific vhosts requires `add_listen =>
3 # 'false'` on the non-IP vhosts
4
5 # Base class. Turn off the default vhosts; we will be declaring
6 # all vhosts below.
7 class { 'apache':
8   default_vhost => false,
9 }
10
11
12 # Add two an IP-based vhost on 10.0.0.10, ssl and non-ssl
13 apache::vhost { 'The first IP-based vhost, non-ssl':
14   servername => 'first.example.com',
15   ip         => '10.0.0.10',
16   port       => '80',
17   ip_based   => true,
18   docroot    => '/var/www/first',
19 }
20 apache::vhost { 'The first IP-based vhost, ssl':
21   servername => 'first.example.com',
22   ip         => '10.0.0.10',
23   port       => '443',
24   ip_based   => true,
25   docroot    => '/var/www/first-ssl',
26   ssl        => true,
27 }
28
29 # Two name-based vhost listening on 10.0.0.20
30 apache::vhost { 'second.example.com':
31   ip      => '10.0.0.20',
32   port    => '80',
33   docroot => '/var/www/second',
34 }
35 apache::vhost { 'third.example.com':
36   ip      => '10.0.0.20',
37   port    => '80',
38   docroot => '/var/www/third',
39 }
40
41 # Two name-based vhosts without IPs specified, so that they will answer on either 10.0.0.10 or 10.0.0.20 . It is requried to declare
42 # `add_listen => 'false'` to disable declaring "Listen 80" which will conflict
43 # with the IP-based preceeding vhosts.
44 apache::vhost { 'fourth.example.com':
45   port       => '80',
46   docroot    => '/var/www/fourth',
47   add_listen => false,
48 }
49 apache::vhost { 'fifth.example.com':
50   port       => '80',
51   docroot    => '/var/www/fifth',
52   add_listen => false,
53 }