Mercurial > repos > other > Puppet
diff modules/website/manifests/init.pp @ 284:9431aec4d998
Switch to using IPv6 prefix and IP per site
This is because the proxy seems to break SNI, so we need an IP
per SSL cert. We're not short of IPv6 addresses, though!
Also corrected to "4to6" naming, because we're letting IPv4 access
an IPv6 site
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 16 Feb 2020 12:07:35 +0000 |
parents | af7df930a670 |
children | e765073832d9 |
line wrap: on
line diff
--- a/modules/website/manifests/init.pp Sat Feb 15 20:11:23 2020 +0000 +++ b/modules/website/manifests/init.pp Sun Feb 16 12:07:35 2020 +0000 @@ -2,8 +2,10 @@ Pattern[/^(\/[^\/]+)*$/] $base_dir, Pattern[/^(\/[^\/]+)*$/] $cert_dir = '/etc/pki/custom', Stdlib::IP::Address $primary_ip, - Stdlib::IP::Address::V6 $proxy_6to4_ip = undef, - Array[Stdlib::IP::Address::V6] $proxy_upstream = undef, + Stdlib::IP::Address::V6 $proxy_4to6_ip_prefix = undef, + Optional[Integer] $proxy_4to6_mask = undef, + Array[Stdlib::IP::Address::V6] $proxy_4to6_addresses = [], + Array $proxy_upstream = undef, String $default_owner, String $default_group, String $default_tld = 'com', @@ -125,25 +127,27 @@ proto => tcp, action => accept, } - if ($proxy_6to4_ip != undef) and ($proxy_upstream != undef) { + if ($proxy_4to6_ip_prefix != undef) and ($proxy_upstream != undef) { + $ipv6_secondaries = join($proxy_4to6_addresses, " ") augeas {'/etc/sysconfig/network-scripts/ifcfg-eth0': context => "/files/etc/sysconfig/network-scripts/ifcfg-eth0", - changes => "set IPV6ADDR_SECONDARIES $proxy_6to4_ip", + changes => "set IPV6ADDR_SECONDARIES '$ipv6_secondaries'", } apache::mod { "remoteip": } + $proxy_4to6_ip = "$proxy_4to6_ip_prefix:0000/$proxy_4to6_mask" $proxy_upstream.each |String $upstream_addr| { firewall { "100 limit PROXY protocol to upstream $upstream_addr": source => $upstream_addr, - destination => $proxy_6to4_ip, + destination => $proxy_4to6_ip, dport => [80, 443], proto => tcp, action => accept, } } firewall { "101 block all other PROXY protocol access": - destination => $proxy_6to4_ip, + destination => $proxy_4to6_ip, dport => [80, 443], proto => tcp, action => reject,