From c85859ca2d740244424a1ac7e290da9495c3310a Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Sat, 7 May 2016 18:37:27 -0400 Subject: [PATCH] Add debian-ceph-jewel mirror to AFS As more teams will be switching to jewel from hammer, we also need to provide a debian mirror for it. Change-Id: I0f5097672c0afd092380d841c665c3fdfa25f280 Signed-off-by: Paul Belanger --- .../files/reprepro/debian-ceph-jewel-updates | 7 ++++++ modules/openstack_project/manifests/mirror.pp | 12 ++++++++++ .../manifests/mirror_update.pp | 22 +++++++++++++++++++ .../distributions.debian-ceph-jewel.erb | 11 ++++++++++ 4 files changed, 52 insertions(+) create mode 100644 modules/openstack_project/files/reprepro/debian-ceph-jewel-updates create mode 100644 modules/openstack_project/templates/reprepro/distributions.debian-ceph-jewel.erb diff --git a/modules/openstack_project/files/reprepro/debian-ceph-jewel-updates b/modules/openstack_project/files/reprepro/debian-ceph-jewel-updates new file mode 100644 index 0000000000..021796bde2 --- /dev/null +++ b/modules/openstack_project/files/reprepro/debian-ceph-jewel-updates @@ -0,0 +1,7 @@ +Name: debian-ceph-jewel +Method: http://download.ceph.com/debian-jewel/ +Components: main +UDebComponents: main +Architectures: amd64 +GetInRelease: no +VerifyRelease: 460f3994 diff --git a/modules/openstack_project/manifests/mirror.pp b/modules/openstack_project/manifests/mirror.pp index 57fe5fd792..f1ed70e8e6 100644 --- a/modules/openstack_project/manifests/mirror.pp +++ b/modules/openstack_project/manifests/mirror.pp @@ -9,6 +9,7 @@ class openstack_project::mirror ( $wheel_root = "${mirror_root}/wheel" $npm_root = "${mirror_root}/npm" $ceph_deb_hammer_root = "${mirror_root}/ceph-deb-hammer" + $ceph_deb_jewel_root = "${mirror_root}/ceph-deb-jewel" $www_base = '/var/www' $www_root = "${www_base}/mirror" @@ -117,6 +118,17 @@ class openstack_project::mirror ( ] } + # Create the symlink to ceph-deb-jewel. + file { "${www_root}/ceph-deb-jewel": + ensure => link, + target => "${ceph_deb_jewel_root}", + owner => root, + group => root, + require => [ + File["${www_root}"], + ] + } + # Create the symlink to Ubuntu Cloud Archive. file { "${www_root}/ubuntu-cloud-archive": ensure => link, diff --git a/modules/openstack_project/manifests/mirror_update.pp b/modules/openstack_project/manifests/mirror_update.pp index 8018639c7c..10d9025625 100644 --- a/modules/openstack_project/manifests/mirror_update.pp +++ b/modules/openstack_project/manifests/mirror_update.pp @@ -164,6 +164,28 @@ class openstack_project::mirror_update ( ] } + ::openstack_project::reprepro { 'debian-ceph-jewel-reprepro-mirror': + confdir => '/etc/reprepro/debian-ceph-jewel', + basedir => '/afs/.openstack.org/mirror/ceph-deb-jewel', + distributions => 'openstack_project/reprepro/distributions.debian-ceph-jewel.erb', + updates_file => 'puppet:///modules/openstack_project/reprepro/debian-ceph-jewel-updates', + releases => ['trusty', 'xenial'], + } + + cron { 'reprepro debian ceph jewel': + user => $user, + hour => '*/2', + minute => '0', + command => 'flock -n /var/run/reprepro/debian-ceph-jewel.lock reprepro-mirror-update /etc/reprepro/debian-ceph-jewel mirror.deb-jewel >>/var/log/reprepro/debian-ceph-jewel-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['debian-ceph-jewel-reprepro-mirror'], + ] + } + gnupg_key { 'Ceph Archive': ensure => present, # 08B7 3419 AC32 B4E9 66C1 A330 E84A C2C0 460F 3994 diff --git a/modules/openstack_project/templates/reprepro/distributions.debian-ceph-jewel.erb b/modules/openstack_project/templates/reprepro/distributions.debian-ceph-jewel.erb new file mode 100644 index 0000000000..0229712bc9 --- /dev/null +++ b/modules/openstack_project/templates/reprepro/distributions.debian-ceph-jewel.erb @@ -0,0 +1,11 @@ +<% @releases.each do |release| -%> +Origin: Ceph Jewel +Codename: <%= release %> +Description: OpenStack Debian Ceph Jewel <%= release.capitalize %> mirror +Architectures: amd64 +Components: main +Contents: .gz +Update: debian-ceph-jewel +Log: <%= @logdir %>/debian-ceph-jewel-<%= release %>.log + +<% end -%>