X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Froles%2Fmanifests%2Fstatic_mirror_web.pp;h=950738384e3851013410e6fd99b9ec3cd73c258d;hb=0f82767f57e613e31170d9885fc0503c18ed27a5;hp=8c04475b8f95747b1bd26f8d7000a5616d8cf2db;hpb=bc0932e7d274b8c9466bb5346bf8746010792d33;p=mirror%2Fdsa-puppet.git diff --git a/modules/roles/manifests/static_mirror_web.pp b/modules/roles/manifests/static_mirror_web.pp index 8c04475b8..950738384 100644 --- a/modules/roles/manifests/static_mirror_web.pp +++ b/modules/roles/manifests/static_mirror_web.pp @@ -16,6 +16,7 @@ class roles::static_mirror_web( include roles::static_mirror include roles::weblog_provider + include apache2 include apache2::expires include apache2::rewrite @@ -38,39 +39,39 @@ class roles::static_mirror_web( } apache2::site { '010-planet.debian.org': - site => 'planet.debian.org', ensure => has_static_component('planet.debian.org') ? { true => 'present', false => 'absent' }, + site => 'planet.debian.org', content => template('roles/static-mirroring/vhost/planet.debian.org.erb'), } apache2::site { '010-lintian.debian.org': - site => 'lintian.debian.org', - ensure => absent, + ensure => absent, + site => 'lintian.debian.org', } apache2::site { '010-static-vhosts-00-manpages': - site => 'static-manpages.debian.org', ensure => has_static_component('manpages.debian.org') ? { true => 'present', false => 'absent' }, + site => 'static-manpages.debian.org', content => template('roles/static-mirroring/vhost/manpages.debian.org.erb'), } apache2::site { '010-static-vhosts-simple': - site => 'static-vhosts-simple', + site => 'static-vhosts-simple', content => template('roles/static-mirroring/vhost/static-vhosts-simple.erb'), } $wwwdo_server_name = 'www.debian.org' $wwwdo_document_root = '/srv/static.debian.org/mirrors/www.debian.org/cur' apache2::site { '005-www.debian.org': - site => 'www.debian.org', ensure => has_static_component('www.debian.org') ? { true => 'present', false => 'absent' }, + site => 'www.debian.org', content => template('roles/apache-www.debian.org.erb'), } ssl::service { 'www.debian.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, } ssl::service { 'debian.org' : - ensure => has_static_component('www.debian.org') ? { true => 'present', false => 'absent' }, - notify => Exec['service apache2 reload'], - key => true, + ensure => has_static_component('www.debian.org') ? { true => 'present', false => 'absent' }, + notify => Exec['service apache2 reload'], + key => true, } # do @@ -90,8 +91,8 @@ class roles::static_mirror_web( ssl::service { 'manpages.debian.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, } ssl::service { 'metadata-backend.ftp-master.debian.org': ensure => has_static_component('metadata.ftp-master.debian.org') ? { true => 'present', false => 'absent' }, - notify => Exec['service apache2 reload'], - key => true, + notify => Exec['service apache2 reload'], + key => true, } ssl::service { 'mirror-master.debian.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, } ssl::service { 'onion.debian.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, } @@ -125,7 +126,6 @@ class roles::static_mirror_web( ssl::service { 'debconf16.debconf.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, } ssl::service { 'debconf17.debconf.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, } ssl::service { 'debconf18.debconf.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, } - ssl::service { 'debconf19.debconf.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, } ssl::service { 'debconf2.debconf.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, } ssl::service { 'debconf3.debconf.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, } ssl::service { 'debconf4.debconf.org' : ensure => 'ifstatic', notify => Exec['service apache2 reload'], key => true, } @@ -142,7 +142,10 @@ class roles::static_mirror_web( if $onion_service { - $onion_addr = filter_ipv4($listen_addr)[0] + $onion_addr = empty($listen_addr) ? { + true => $base::public_address, + default => filter_ipv4($listen_addr)[0] + } if ! $onion_addr { fail("Do not have a useable address for the onionservice on ${::hostname}. Is \$listen_addr empty or does it not have an IPv4 address?.") } @@ -170,7 +173,7 @@ class roles::static_mirror_web( onion::service { 'security-team.debian.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr } onion::service { 'www.ports.debian.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr } # dn - onion::service { 'bootstrap.debian.net' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr } + onion::service { 'bootstrap.debian.net' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr } onion::service { 'debaday.debian.net' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr } onion::service { 'debdeltas.debian.net' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr } onion::service { 'micronews.debian.org' : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr } @@ -202,11 +205,11 @@ class roles::static_mirror_web( file { '/srv/static.debian.org/puppet': ensure => directory, - mode => '02755' + mode => '2755' } file { '/srv/static.debian.org/puppet/disabled-service': ensure => directory, - mode => '02755' + mode => '2755' } file { '/srv/static.debian.org/puppet/disabled-service/503.html': source => 'puppet:///modules/roles/static-htdocs/disabled-service/503.html',