ansible/tasks/yumrepos.yml

151 lines
5.2 KiB
YAML
Raw Normal View History

---
- name: Include vars/all/
include_vars:
dir: /srv/web/infra/ansible/vars/all/
ignore_files: [README]
tags:
- config
- packages
- yumrepos
- name: enable repos for archived Fedora releases
set_fact:
archive_if_archived: >-
{{
'/archive'
if ansible_distribution_major_version|int < (
FedoraPreviousPreviousCycleNumber|int
if FedoraPreviousPrevious == True
else FedoraPreviousCycleNumber|int
)
else ''
}}
when: ansible_distribution == 'Fedora'
tags:
- config
- packages
- yumrepos
- name: put rhel repos on rhel systems
copy: src="{{ files }}/common/rhel{{ ansible_distribution_major_version|int }}.repo" dest="/etc/yum.repos.d/rhel{{ ansible_distribution_major_version|int }}.repo"
when: ansible_distribution == 'RedHat' and not inventory_hostname.startswith('ppc9') and datacenter != "aws"
tags:
- config
- packages
- yumrepos
- name: put rhel repos on rhel systems (power9)
copy: src="{{ files }}/common/rhel{{ ansible_distribution_major_version|int }}-power9.repo" dest="/etc/yum.repos.d/rhel{{ ansible_distribution_major_version|int }}.repo"
when: ansible_distribution == 'RedHat' and inventory_hostname.startswith('ppc9') and datacenter != "aws"
2014-06-20 23:18:51 +00:00
tags:
- config
- packages
2014-09-30 00:03:50 +00:00
- yumrepos
2014-06-20 23:18:51 +00:00
- name: put epel repos on el systems
copy: src="{{ files }}/common/epel{{ ansible_distribution_major_version|int }}.repo" dest="/etc/yum.repos.d/epel{{ ansible_distribution_major_version|int }}.repo"
2021-03-15 21:03:08 +01:00
when: ((ansible_distribution == 'RedHat' or ansible_distribution == 'CentOS') and use_default_epel) and datacenter != "aws"
tags:
- config
- packages
2014-09-30 00:03:50 +00:00
- yumrepos
- name: put epel repos on el systems (aws)
copy: src="{{ files }}/common/original-epel{{ ansible_distribution_major_version|int }}.repo" dest="/etc/yum.repos.d/epel{{ ansible_distribution_major_version|int }}.repo"
2021-03-15 21:05:27 +01:00
when: ((ansible_distribution == 'RedHat' or ansible_distribution == 'CentOS') and use_default_epel) and datacenter == "aws"
tags:
- config
- packages
- yumrepos
- name: put epel gpg key on el systems (aws)
2021-03-15 21:09:52 +01:00
copy: src="{{ files }}/common/RPM-GPG-KEY-EPEL-{{ ansible_distribution_major_version|int }}" dest="/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-{{ ansible_distribution_major_version|int }}"
2021-03-15 21:05:27 +01:00
when: ((ansible_distribution == 'RedHat' or ansible_distribution == 'CentOS') and use_default_epel) and datacenter == "aws"
tags:
- config
- packages
- yumrepos
- name: epel release on el systems (aws)
package:
name: 'epel-release'
state: present
when: (((ansible_distribution == 'RedHat' or ansible_distribution == 'CentOS') and ansible_distribution_major_version|int != 9) and use_default_epel) and datacenter == "aws"
tags:
- config
- packages
- yumrepos
2018-05-08 19:53:52 +00:00
- name: put fedora repos on primary architecture systems
template: src="{{ files }}/common/{{ item }}" dest="/etc/yum.repos.d/{{ item }}"
with_items:
- fedora.repo
- fedora-updates.repo
- fedora-updates-testing.repo
when: ansible_distribution == 'Fedora' and not inventory_hostname.startswith(('buildvm-s390x', 'buildvm-ppc64le','bvmhost-p09','buildvmhost-s390x-01')) and not inventory_hostname.startswith('rawhide-test') and datacenter != "aws"
tags:
- config
- packages
- yumrepos
- name: put fedora repos on secondary architecture systems
2018-05-08 20:01:28 +00:00
template: src="{{ files }}/common/{{ item }}-secondary" dest="/etc/yum.repos.d/{{ item }}"
with_items:
- fedora.repo
- fedora-updates.repo
- fedora-updates-testing.repo
when: ansible_distribution == 'Fedora' and (ansible_architecture == 'ppc64le' or ansible_architecture == 's390x') and datacenter != "aws"
tags:
- config
- packages
- yumrepos
- name: add infrastructure tags repo - RHEL
copy: src="{{ files }}/common/rhel-infra-tags.repo" dest="/etc/yum.repos.d/infra-tags.repo"
when: ((ansible_distribution == 'RedHat' or ansible_distribution == 'CentOS'))
tags:
- config
- packages
- yumrepos
- name: add infrastructure STAGING tags repo - RHEL
copy: src="{{ files }}/common/rhel-infra-tags-stg.repo" dest="/etc/yum.repos.d/infra-tags-stg.repo"
when: (ansible_distribution == 'RedHat' or ansible_distribution == 'CentOS') and env in ['staging', 'pagure-staging']
tags:
- config
- packages
- yumrepos
- name: add infrastructure tags repo - Fedora
copy: src="{{ files }}/common/fedora-infra-tags.repo" dest="/etc/yum.repos.d/infra-tags.repo"
when: ansible_distribution == 'Fedora'
tags:
- config
- packages
- yumrepos
- name: add infrastructure STAGING tags repo - Fedora
copy: src="{{ files }}/common/fedora-infra-tags-stg.repo" dest="/etc/yum.repos.d/infra-tags-stg.repo"
when: ansible_distribution == 'Fedora' and env in ['staging', 'pagure-staging']
tags:
- config
- packages
- yumrepos
- name: Make sure older infrastructure tags repos no longer exist
file: path="/etc/yum.repos.d/{{item}}" state=absent
with_items:
- fedora-modular.repo
- fedora-updates-modular.repo
- fedora-updates-testing-modular.repo
- fedora-infra-tags.repo
- fedora-infra-tags-stg.repo
- rhel-infra-tags.repo
- rhel-infra-tags-stg.repo
- infrastructure.repo
- infrastructure-testing.repo
tags:
- config
- packages
- yumrepos