Add archive rsync to historical_mirror role
authorPeter Palfrader <peter@palfrader.org>
Fri, 24 Feb 2017 08:37:43 +0000 (09:37 +0100)
committerPeter Palfrader <peter@palfrader.org>
Fri, 24 Feb 2017 08:37:43 +0000 (09:37 +0100)
modules/roles/files/historical_master/rsyncd.conf [deleted file]
modules/roles/files/historical_mirror/rsyncd.conf [new file with mode: 0644]
modules/roles/manifests/historical_master.pp [deleted file]
modules/roles/manifests/historical_mirror.pp
modules/roles/manifests/init.pp

diff --git a/modules/roles/files/historical_master/rsyncd.conf b/modules/roles/files/historical_master/rsyncd.conf
deleted file mode 100644 (file)
index 976bb13..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-uid = nobody
-gid = nogroup
-max connections = 25
-syslog facility = daemon
-socket options = SO_KEEPALIVE
-timeout = 7200
-log file = /var/log/rsyncd/rsyncd-archive.log
-
-[debian-archive]
-  path = /srv/mirrors/debian-archive
-  comment = Debian Historical Archives (use -H to save space)
-  read only = true
-
-[archive]
-  path = /srv/mirrors/debian-archive
-  comment = Debian Archive (use -H to save space)
-  read only = true
-  list = no
diff --git a/modules/roles/files/historical_mirror/rsyncd.conf b/modules/roles/files/historical_mirror/rsyncd.conf
new file mode 100644 (file)
index 0000000..976bb13
--- /dev/null
@@ -0,0 +1,18 @@
+uid = nobody
+gid = nogroup
+max connections = 25
+syslog facility = daemon
+socket options = SO_KEEPALIVE
+timeout = 7200
+log file = /var/log/rsyncd/rsyncd-archive.log
+
+[debian-archive]
+  path = /srv/mirrors/debian-archive
+  comment = Debian Historical Archives (use -H to save space)
+  read only = true
+
+[archive]
+  path = /srv/mirrors/debian-archive
+  comment = Debian Archive (use -H to save space)
+  read only = true
+  list = no
diff --git a/modules/roles/manifests/historical_master.pp b/modules/roles/manifests/historical_master.pp
deleted file mode 100644 (file)
index c0953f1..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-class roles::historical_master {
-       $sslname = 'archive-master.debian.org'
-
-       rsync::site_systemd { 'archive_master':
-               source      => 'puppet:///modules/roles/historical_master/rsyncd.conf',
-               max_clients => 100,
-               sslname     => $sslname,
-       }
-
-       ssl::service { $sslname:
-               key      => true,
-               tlsaport => [],
-       }
-}
index 8538481..6bd1be2 100644 (file)
@@ -2,10 +2,27 @@ class roles::historical_mirror {
        include roles::archvsync_base
        include apache2::expires
 
-       $vhost_listen = $::hostname ? {
-               klecker => '130.89.148.13:80 2001:610:1908:b000::148:13:80',
-               default => '*:80',
+       $rsync_bind = $::hostname ? {
+               gretchaninov => '209.87.16.41',
+               klecker => '130.89.148.13',
+               mirror-conova => '217.196.149.234',
+               sibelius => '193.62.202.28',
+               default    => '',
        }
+       $rsync_bind6 = $::hostname ? {
+               gretchaninov => '2607:f8f0:614:1::1274:41',
+               klecker => '2001:610:1908:b000::148:13',
+               mirror-conova => '2a02:16a8:dc41:100::234',
+               sibelius => '2001:630:206:4000:1a1a:0:c13e:ca1c',
+               default    => '',
+       }
+
+       $vhost_listen = join([
+               ($rsync_bind  == '') ? { true => "*:80", default => "$rsync_bind:80" },
+               ($rsync6_bind == '') ? { true => "*:80", default => "[$rsync6_bind]:80" }
+               ], ' ')
+       }
+
        $onion_v4_addr = $::hostname ? {
                default    => undef,
        }
@@ -18,6 +35,24 @@ class roles::historical_mirror {
                content => template('roles/apache-archive.debian.org.erb'),
        }
 
+       if has_role('historical_master') {
+               $sslname = 'archive-master.debian.org'
+               ssl::service { $sslname:
+                       key      => true,
+                       tlsaport => [],
+               }
+       } else {
+               $sslname = ''
+       }
+
+       rsync::site_systemd { 'archive':
+               source      => 'puppet:///modules/roles/historical_mirror/rsyncd.conf',
+               max_clients => 100,
+               sslname     => $sslname,
+               bind        => $rsync_bind,
+               bind6       => $rsync_bind6,
+       }
+
        if has_role('historical_mirror_onion') {
                if ! $onion_v4_addr {
                        fail("Do not have an onion_v4_addr set for $::hostname.")
index a852abd..592397c 100644 (file)
@@ -57,9 +57,6 @@ class roles {
        }
 
        # archive.debian.org
-       if has_role('historical_master') {
-               include historical_master
-       }
        if has_role('historical_mirror') {
                include roles::historical_mirror
        }