From 0f615ef6f47d3cbb3ad38198c80f995a4d451cea Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Sat, 9 Jan 2016 15:07:02 +0000 Subject: [PATCH] Add playbook for releng to expire old repo versions This depends on: https://github.com/fedora-infra/mirrormanager2/pull/154 Signed-off-by: Patrick Uiterwijk --- .../releng-emergency-expire-old-repo.yml | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 playbooks/manual/releng-emergency-expire-old-repo.yml diff --git a/playbooks/manual/releng-emergency-expire-old-repo.yml b/playbooks/manual/releng-emergency-expire-old-repo.yml new file mode 100644 index 0000000000..d0db28885a --- /dev/null +++ b/playbooks/manual/releng-emergency-expire-old-repo.yml @@ -0,0 +1,34 @@ +# Expire old repo metadata from mirrormanager +# +# This playbook will mark all older versions of a distro version to be outdated +# so that metalink will not serve for old versions. +# CAUTION: Until mirrors pick up the new content, this will mean that the master +# mirror is the only one deemed respectable, and as such should be used very +# sparingly! +# +# requires --extra-vars="product=Fedora version=23" +# +# Possible product: Fedora/EPEL/RHEL + +- name: Expire old repo files + hosts: mm-backend01.phx2.fedoraproject.org + user: root + gather_facts: False + + vars_files: + - /srv/web/infra/ansible/vars/global.yml + - "/srv/private/ansible/vars.yml" + - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml + + tasks: + - name: Expire old files + command: /usr/bin/mm2_emergency-expire-repo {{product}} {{version}} + + - name: Recreate pickle + command: /usr/bin/mm2_update-mirrorlist-server + + - name: Sync the pickle + command: /usr/local/bin/sync_pkl_to_mirrorlists.sh + + handlers: + - include: "{{ handlers }}/restart_services.yml"