53 lines
1.7 KiB
YAML
53 lines
1.7 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: os_control
|
|
# Testing for now:
|
|
hosts: os_control_stg
|
|
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
|
|
- /srv/web/infra/ansible/vars/apps/mirrormanager.yml
|
|
|
|
vars:
|
|
app: mirrormanager
|
|
job_name: cmd-emergency-expire-repo-{{ product|lower|replace(" ", "-") }}-{{ version|lower|replace(" ", "-") }}
|
|
|
|
tasks:
|
|
|
|
- name: Validate parameters
|
|
assert:
|
|
that:
|
|
- product is defined
|
|
- version is defined
|
|
fail_msg: "You need to define product and version"
|
|
|
|
- include_role:
|
|
name: openshift/object
|
|
vars:
|
|
template: cmd-emergency-expire-repo.yml
|
|
objectname: cmd-emergency-expire-repo.yml
|
|
|
|
- debug:
|
|
msg: "You can watch the logs with 'oc -n {{ app }} logs -f job/{{ job_name }}'"
|
|
|
|
- name: Wait for the command to complete
|
|
shell: oc -n {{ app }} wait --for=condition=Complete --timeout=10m job/{{ job_name }}
|