Fix debian-docker mirroring

Unfortunately we can't mix the distributions here, because upstream
keeps the same filename, built differently, in each distributions
separate pool.  So we can't combine it back into one pool.

Mirror each into a separate subdirectory.

Change-Id: I728d38daf9a953a64364689da0648c9339a27693
This commit is contained in:
Ian Wienand 2020-08-14 13:20:43 +10:00
parent 69a92d0d9d
commit 3eabc630c4

View File

@ -329,25 +329,47 @@ class openstack_project::mirror_update (
}
## Docker APT mirror
::openstack_project::reprepro { 'debian-docker-reprepro-mirror':
confdir => '/etc/reprepro/debian-docker',
basedir => '/afs/.openstack.org/mirror/deb-docker',
# Unfortunately docker upstream doesn't do the pool model correctly,
# and we have to mirror each distro separately to avoid file
# conflicts (they have the same .deb files)
::openstack_project::reprepro { 'debian-docker-bionic-reprepro-mirror':
confdir => '/etc/reprepro/debian-docker-bionic',
basedir => '/afs/.openstack.org/mirror/deb-docker/bionic',
distributions => 'openstack_project/reprepro/distributions.debian-docker.erb',
updates_file => 'puppet:///modules/openstack_project/reprepro/debian-docker-updates',
releases => ['bionic', 'xenial'],
releases => ['bionic'],
}
::openstack_project::reprepro { 'debian-docker-xenial-reprepro-mirror':
confdir => '/etc/reprepro/debian-docker-xenial',
basedir => '/afs/.openstack.org/mirror/deb-docker/xenial',
distributions => 'openstack_project/reprepro/distributions.debian-docker.erb',
updates_file => 'puppet:///modules/openstack_project/reprepro/debian-docker-updates',
releases => ['xenial'],
}
::openstack_project::reprepro { 'debian-docker-focal-reprepro-mirror':
confdir => '/etc/reprepro/debian-docker-focal',
basedir => '/afs/.openstack.org/mirror/deb-docker/focal',
distributions => 'openstack_project/reprepro/distributions.debian-docker.erb',
updates_file => 'puppet:///modules/openstack_project/reprepro/debian-docker-updates',
releases => ['focal'],
}
cron { 'reprepro debian docker':
user => 'root',
hour => '*/2',
minute => fqdn_rand(45, 'debian-docker'),
command => 'flock -n /var/run/reprepro/debian-docker.lock reprepro-mirror-update /etc/reprepro/debian-docker mirror.deb-docker >>/var/log/reprepro/debian-docker-mirror.log 2>&1',
command => 'flock -n /var/run/reprepro/debian-docker.lock bash -c "for DISTRO in xenial bionic focal; do reprepro-mirror-update /etc/reprepro/debian-docker-\$DISTRO mirror.deb-docker >>/var/log/reprepro/debian-docker-\$DISTRO-mirror.log; done" 2>&1',
environment => 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin',
require => [
File['/usr/local/bin/reprepro-mirror-update'],
File['/etc/afsadmin.keytab'],
File['/etc/reprepro.keytab'],
::Openstack_project::Reprepro['debian-docker-reprepro-mirror'],
::Openstack_project::Reprepro['debian-docker-xenial-reprepro-mirror'],
::Openstack_project::Reprepro['debian-docker-bionic-reprepro-mirror'],
::Openstack_project::Reprepro['debian-docker-focal-reprepro-mirror'],
]
}