ansible/playbooks/manual/releng-emergency-expire-old-repo.yml
Kevin Fenzi 7984b46eb7 The great phx2 pruning run (1st cut).
Since we no longer have any machines in phx2, I have tried to remove
them from ansible. Note that there are still some places where we need
to remove them still: nagios, dhcp, named were not touched, and in cases
where it wasn't pretty clear what a conditional was doing I left it to
be cleaned up later.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-06-14 14:14:31 -07:00

38 lines
1.3 KiB
YAML

# 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 <alternates> 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!
#
# Before running this playbook, please make sure that:
# 1. The new updates repo is mashed and pushed to the master mirrors
# 2. The next UMDL run has occured to allow mirrormanager to pick up the new repo
#
# requires --extra-vars="product=Fedora version=23"
#
# Possible product: Fedora/EPEL/RHEL
- name: Expire old repo files
hosts: mm-backend01.iad2.fedoraproject.org
become_user: mirrormanager
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:
- import_tasks: "{{ handlers_path }}/restart_services.yml"