From 3eabc630c450a87cea7f7c6aaa98513418557b5e Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Fri, 14 Aug 2020 13:20:43 +1000 Subject: [PATCH] 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 --- .../manifests/mirror_update.pp | 34 +++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/modules/openstack_project/manifests/mirror_update.pp b/modules/openstack_project/manifests/mirror_update.pp index fc2fbefe4c..f60d423269 100644 --- a/modules/openstack_project/manifests/mirror_update.pp +++ b/modules/openstack_project/manifests/mirror_update.pp @@ -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'], ] }