move the onion address lookup for people.d.o to the template
authorJulien Cristau <jcristau@debian.org>
Tue, 24 Sep 2019 11:32:26 +0000 (13:32 +0200)
committerJulien Cristau <jcristau@debian.org>
Tue, 24 Sep 2019 11:32:26 +0000 (13:32 +0200)
modules/roles/manifests/people.pp
modules/roles/templates/apache-people.debian.org.conf.erb

index 0ab4969..2e3211b 100644 (file)
@@ -20,7 +20,6 @@ class roles::people (
     default => enclose_ipv6($listen_addr),
   }
   $vhost_listen = $_enclosed_addresses.map |$a| { "${a}:443" } . join(' ')
-  $onion_hn = onion_tor_service_hostname('people.debian.org')
   apache2::site { 'people.debian.org':
     site => 'people.debian.org.conf',
     content => template('roles/apache-people.debian.org.conf.erb'),
index 831c9dd..d39525a 100644 (file)
@@ -38,8 +38,9 @@ Use common-debian-service-https-redirect * people.debian.org
        Use vhost-inner-people.debian.org
 </VirtualHost>
 
+<% if scope.function_onion_global_service_hostname(['people.debian.org']) -%>
 <VirtualHost *:80>
-       ServerName <%= @onion_hn %>
+       ServerName <%= scope.function_onion_global_service_hostname(['people.debian.org']) %>
        Use vhost-inner-people.debian.org
 </VirtualHost>
-
+<% end -%>