OpenStack-CI Apt mirror for Ubuntu Cloud Archive

This patch adds a mirror for Ubuntu Cloud Archive. The releases
mirrored is selective, only covering the currently supported
Ubuntu and OpenStack versions.

Having this mirror available aids deployment projects which
consume these packages by ensuring that all apt packages needed
are available in mirror local to the nodepool cloud provider.

Note:
I have no real understanding of how puppet/system-config works
and don't know how to test this patch. If there's no
system-config gate check to validate that this works, please can
someone assist by testing and providing feedback.

Change-Id: Id658f2f29ce4a42eee2ef1ecdf935ada882da51e
This commit is contained in:
Jesse Pretorius 2016-06-15 19:45:52 +01:00
parent b69a663a91
commit 0f291dc788
5 changed files with 116 additions and 0 deletions

View File

@ -0,0 +1,52 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQINBFAqSlgBEADPKwXUwqbgoDYgR20zFypxSZlSbrttOKVPEMb0HSUx9Wj8VvNC
r+mT4E9wAyq7NTIs5ad2cUhXoyenrjcfGqK6k9R6yRHDbvAxCSWTnJjw7mzsajDN
ocXC6THKVW8BSjrh0aOBLpht6d5QCO2vyWxw65FKM65GOsbX03ZngUPMuOuiOEHQ
Zo97VSH2pSB+L+B3d9B0nw3QnU8qZMne+nVWYLYRXhCIxSv1/h39SXzHRgJoRUFH
vL2aiiVrn88NjqfDW15HFhVJcGOFuACZnRA0/EqTq0qNo3GziQO4mxuZi3bTVL5s
GABiYW9uIlokPqcS7Fa0FRVIU9R+bBdHZompcYnKAeGag+uRvuTqC3MMRcLUS9Oi
/P9I8fPARXUPwzYN3fagCGB8ffYVqMunnFs0L6td08BgvWwer+Buu4fPGsQ5OzMc
lgZ0TJmXyOlIW49lc1UXnORp4sm7HS6okA7P6URbqyGbaplSsNUVTgVbi+vc8/jY
dfExt/3HxVqgrPlq9htqYgwhYvGIbBAxmeFQD8Ak/ShSiWb1FdQ+f7Lty+4mZLfN
8x4zPZ//7fD5d/PETPh9P0msF+lLFlP564+1j75wx+skFO4v1gGlBcDaeipkFzeo
zndAgpegydKSNTF4QK9iTYobTIwsYfGu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kBtLSFVjBwaG5JX89mgttYW+lw9Rmsb
p9Iw4KKFHIBLOwk7s+u0LUhP3d8neBI6NfkOYKZZCm3CuvkiOeQP9/2okFjtj+29
jEL+9KQwrGNFEVNe85Un5MJfYIjgyqX3nJcwypYxidntnhMhr2VD3HL2R/4CiswB
Oa4g9309p/+af/HU1smBrOfIeRoxb8jQoHu3
=xg4S
-----END PGP PUBLIC KEY BLOCK-----

View File

@ -0,0 +1,7 @@
Name: ubuntu-cloud-archive
Method: http://ubuntu-cloud.archive.canonical.com/ubuntu
Components: main
UDebComponents: main
Architectures: amd64
GetInRelease: no
VerifyRelease: EC4926EA

View File

@ -106,6 +106,17 @@ class openstack_project::mirror (
] ]
} }
# Create the symlink to Ubuntu Cloud Archive.
file { "${www_root}/ubuntu-cloud-archive":
ensure => link,
target => "${mirror_root}/ubuntu-cloud-archive",
owner => root,
group => root,
require => [
File["${www_root}"],
]
}
file { "${www_root}/robots.txt": file { "${www_root}/robots.txt":
ensure => present, ensure => present,
owner => 'root', owner => 'root',

View File

@ -253,4 +253,36 @@ class openstack_project::mirror_update (
File['/etc/epel.keytab'], File['/etc/epel.keytab'],
] ]
} }
### Ubuntu Cloud Archive Mirror ###
::openstack_project::reprepro { 'ubuntu-cloud-archive-reprepro-mirror':
confdir => '/etc/reprepro/ubuntu-cloud-archive',
basedir => '/afs/.openstack.org/mirror/ubuntu-cloud-archive',
distributions => 'openstack_project/reprepro/distributions.ubuntu-cloud-archive.erb',
updates_file => 'puppet:///modules/openstack_project/reprepro/ubuntu-cloud-archive-updates',
releases => { 'trusty'=>['liberty', 'mitaka'], 'xenial'=>['newton'] },
}
cron { 'reprepro ubuntu-cloud-archive':
user => $user,
hour => '*/2',
minute => '0',
command => 'flock -n /var/run/reprepro/ubuntu-cloud-archive.lock reprepro-mirror-update /etc/reprepro/ubuntu-cloud-archive mirror.ubuntu-cloud >>/var/log/reprepro/ubuntu-cloud-archive-mirror.log 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['ubuntu-cloud-archive-reprepro-mirror'],
]
}
gnupg_key { 'Canonical Cloud Archive Signing Key':
ensure => present,
# 391A 9AA2 1471 9283 9E9D B031 5EDB 1B62 EC49 26EA
key_id => '5EDB1B62EC4926EA',
user => 'root',
key_type => 'public',
key_source => 'puppet:///modules/openstack_project/reprepro/ubuntu-cloud-archive-gpg-key.asc',
}
} }

View File

@ -0,0 +1,14 @@
<% releases.each do |distro_codename, openstack_codenames| -%>
<% openstack_codenames.each do |openstack_codename| -%>
Origin: Canonical
Codename: <%= distro_codename %>-updates/<%= openstack_codename %>
Description: OpenStack <%= openstack_codename.capitalize %> Archive for Ubuntu <%= distro_codename.capitalize %>
Architectures: amd64
Components: main
UDebComponents: main
Contents: .gz
Update: <%= distro_codename %>-updates
Log: <%= @logdir %>/ubuntu-cloud-archive-<%= distro_codename %>.log
<% end -%>
<% end -%>