From 94ad759b2e453540787e25c188bf1de42ff4c41e Mon Sep 17 00:00:00 2001
From: Ian Wienand <iwienand@redhat.com>
Date: Tue, 26 Jun 2018 13:49:16 +1000
Subject: [PATCH] More minor debian-security mirror fixes

As a follow-on to Ic33bca431ae19b44e5bc2938de425cc68785b331
... (reprepro configuration really is quite inscrutable outside "try
it and see if it works")

The update is just called "debian-security", no codename.

We want to use the debian-security key to validate the gpg signatures,
update that.

Use the "updates" suite, which seems to be where debian-security is

Add the symlink for mirror

Change-Id: Ice2a06f4274cdad766f427df70d9fe3e92f62e8c
---
 .../files/reprepro/debian-security-updates            |  6 ++----
 modules/openstack_project/manifests/mirror.pp         | 11 +++++++++++
 .../reprepro/distributions.debian-security.erb        |  5 +++--
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/modules/openstack_project/files/reprepro/debian-security-updates b/modules/openstack_project/files/reprepro/debian-security-updates
index 96ef28595f..80d2e41085 100644
--- a/modules/openstack_project/files/reprepro/debian-security-updates
+++ b/modules/openstack_project/files/reprepro/debian-security-updates
@@ -1,8 +1,6 @@
 Name: debian-security
 Method: http://security.debian.org/
-Suite: stretch/updates
-Components: main
-UDebComponents: main
+Suite: */updates
 Architectures: amd64 arm64
 GetInRelease: no
-VerifyRelease: 8AE22BA9
+VerifyRelease: C857C906
diff --git a/modules/openstack_project/manifests/mirror.pp b/modules/openstack_project/manifests/mirror.pp
index ea96c24e07..95d1a4896a 100644
--- a/modules/openstack_project/manifests/mirror.pp
+++ b/modules/openstack_project/manifests/mirror.pp
@@ -87,6 +87,17 @@ class openstack_project::mirror (
     ]
   }
 
+  # Create the symlink to debian-security
+  file { "${www_root}/debian-security":
+    ensure  => link,
+    target  => "${mirror_root}/debian-security",
+    owner   => root,
+    group   => root,
+    require => [
+      File["${www_root}"],
+    ]
+  }
+
   # Create the symlink to Debian OpenStack Packaging Team reprepro.
   file { "${www_root}/debian-openstack":
     ensure  => link,
diff --git a/modules/openstack_project/templates/reprepro/distributions.debian-security.erb b/modules/openstack_project/templates/reprepro/distributions.debian-security.erb
index 2a6ee9f3a6..c28480bc17 100644
--- a/modules/openstack_project/templates/reprepro/distributions.debian-security.erb
+++ b/modules/openstack_project/templates/reprepro/distributions.debian-security.erb
@@ -1,13 +1,14 @@
 <% @releases.each do |release| -%>
 
 Origin: Debian Security
-Codename: <%= release %>-security
+Codename: <%= release %>
+Suite: updates
 Description: OpenStack Debian Security <%= release.capitalize %> mirror
 Architectures: amd64 arm64 source
 Components: main
 UDebComponents: main
 Contents: .gz
-Update: debian-<%= release %>-security
+Update: debian-security
 Log: <%= @logdir %>/debian-security-<%= release %>.log
 
 <% end -%>