ansible/playbooks/manual/mirrormanager/move-to-archive.yml
Aurélien Bompard 692b98ece0
name is a reserved variable
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
2024-11-18 17:33:37 +01:00

37 lines
1.3 KiB
YAML

# This playbook moves a distro version to the archive in MirrorManager's DB
# Usage:
# --extra-vars="product='EPEL' version='7'"
# product => The product name in MirrorManager's DB. Currently one of:
# "Fedora", "EPEL" or "RHEL"
# version => The version that must be archived.
- name: Run the move-to-archive script
hosts: os_control[0]:os_control_stg[0]
user: root
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
handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml"
pre_tasks:
- name: Validate the product {{ product }}
assert:
that:
- product is defined
- product in ["Fedora", "EPEL", "RHEL"]
fail_msg: "The 'product' variable is not set correctly"
- name: Validate the version {{ version }}
assert:
that:
- version is defined
fail_msg: "The 'version' variable is not defined"
roles:
- role: openshift/job
app: mirrormanager
jobname: move-to-archive-{{ product|lower|replace(" ", "-") }}-{{ version|lower|replace(" ", "-") }}
command: "/opt/app-root/bin/mm2_move-to-archive --product {{ product }} --version {{ version }}"