From d00e7c0e5de1a4f2a629cde2c8e8fc2cd1ca1227 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sun, 7 Feb 2016 07:37:17 -0600 Subject: [PATCH] Update paths for AFS mirror In the current setup, the reprepro db and lists dirs are being written into /root. Move them into AFS so that we store all the data in the same place. Also, update the script to point to the confdir for reprepro commands. Note: This will require a manual move of the current db and lists dirs from /root to /afs/.openstack.org/mirror/apt before this is run. Change-Id: I2638621e6af98296704e680227fae174d8a0e541 --- .../files/reprepro/reprepro-mirror-update.sh | 11 ++++++----- modules/openstack_project/manifests/reprepro.pp | 2 +- .../openstack_project/templates/reprepro/options.erb | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/modules/openstack_project/files/reprepro/reprepro-mirror-update.sh b/modules/openstack_project/files/reprepro/reprepro-mirror-update.sh index 75191c021f..3a24af1a38 100644 --- a/modules/openstack_project/files/reprepro/reprepro-mirror-update.sh +++ b/modules/openstack_project/files/reprepro/reprepro-mirror-update.sh @@ -17,21 +17,22 @@ set -e UNREF_FILE=/var/run/reprepro/unreferenced-files +REPREPRO='reprepro --confdir /etc/reprepro' echo "Obtaining reprepro tokens and running reprepro update" -k5start -t -f /etc/reprepro.keytab service/reprepro -- timeout -k 2m 30m reprepro update +k5start -t -f /etc/reprepro.keytab service/reprepro -- timeout -k 2m 30m $REPREPRO update if [ -f $UNREF_FILE ] ; then echo "Cleaning up files made unreferenced on the last run" - k5start -t -f /etc/reprepro.keytab service/reprepro -- timeout -k 2m 30m reprepro deleteifunreferenced < $UNREF_FILE + k5start -t -f /etc/reprepro.keytab service/reprepro -- timeout -k 2m 30m $REPREPRO deleteifunreferenced < $UNREF_FILE fi echo "Saving list of newly unreferenced files for next time" -reprepro dumpunreferenced > $UNREF_FILE +$REPREPRO dumpunreferenced > $UNREF_FILE echo "Checking state of mirror" -reprepro checkpool fast -reprepro check +$REPREPRO checkpool fast +$REPREPRO check echo "reprepro completed successfully, running reprepro export." k5start -t -f /etc/afsadmin.keytab service/afsadmin -- vos release -v mirror.apt diff --git a/modules/openstack_project/manifests/reprepro.pp b/modules/openstack_project/manifests/reprepro.pp index ec7a067cff..32f1534269 100644 --- a/modules/openstack_project/manifests/reprepro.pp +++ b/modules/openstack_project/manifests/reprepro.pp @@ -1,7 +1,7 @@ # == Class: openstack_project::mirror_update # class openstack_project::reprepro ( - $outdir = '/afs/.openstack.org/mirror/apt', + $basedir = '/afs/.openstack.org/mirror/apt', $logdir = '/var/log/reprepro', $updates_file = 'puppet:///modules/openstack_project/reprepro/updates', $options_template = 'openstack_project/reprepro/options.erb', diff --git a/modules/openstack_project/templates/reprepro/options.erb b/modules/openstack_project/templates/reprepro/options.erb index 8a946458b7..91e210123b 100644 --- a/modules/openstack_project/templates/reprepro/options.erb +++ b/modules/openstack_project/templates/reprepro/options.erb @@ -1,4 +1,4 @@ -outdir <%= @outdir %> +basedir <%= @basedir %> keepunreferencedfiles noskipold export changed