Update to 2020-12-10 10:00

master
Daniel Berteaud 4 years ago
parent caf80bd161
commit 141904393a
  1. 3
      roles/repo_base/defaults/main.yml
  2. 149
      roles/repo_base/tasks/base_CentOS8.yml

@ -1,4 +1,7 @@
--- ---
repo_remi_release_uri: "http://rpms.remirepo.net/enterprise/remi-release-{{ ansible_distribution_major_version }}.rpm" repo_remi_release_uri: "http://rpms.remirepo.net/enterprise/remi-release-{{ ansible_distribution_major_version }}.rpm"
repo_postgres: True repo_postgres: True
# Only available for CentOS >= 8
# if True, will switch to the CentOS Stream repo
repo_centos_stream: False
... ...

@ -1,44 +1,117 @@
--- ---
- name: Configure base repositories
yum_repository: - when: not repo_centos_stream
file: CentOS-Linux-{{ item.name }} block:
description: "Centos - {{ item.name }}" - name: Configure repositories
name: "{{ item.name | lower }}" yum_repository:
baseurl: http://mirror.centos.org/$contentdir/$releasever/{{ item.repo }}/$basearch/os/ file: "{{ item.file }}"
gpgcheck: True description: "CentOS {{ item.name }}"
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial name: "{{ item.name }}"
enabled: "{{ item.enabled | default(True) }}" baseurl: http://mirror.centos.org/$contentdir/$releasever/{{ item.dir }}/$basearch/os/
loop: gpgcheck: True
- name: BaseOS gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
repo: BaseOS loop:
- name: AppStream - name: baseos
repo: AppStream file: CentOS-Linux-Base
- name: PowerTools dir: BaseOS
repo: PowerTools - name: appstream
- name: Extras file: CentOS-Linux-AppStream
repo: extras dir: AppStream
- name: ContinuousRelease - name: plus
repo: cr file: CentOS-Linux-Plus
enabled: False dir: centosplus
- name: Plus - name: extras
repo: centosplus file: CentOS-Linux-Extras
enabled: False dir: extras
- name: FastTrack - name: powertools
repo: fasttrack file: CentOS-Linux-PowerTools
enabled: False dir: PowerTools
- name: Remove Base file
file: path=/etc/yum.repos.d/{{ item }}.repo state=absent
loop:
- CentOS-Stream-AppStream
- CentOS-Stream-Base
- CentOS-Stream-ContinuousRelease
- CentOS-Stream-Debuginfo
- CentOS-Stream-Devel
- CentOS-Stream-Extras
- CentOS-Stream-FastTrack
- CentOS-Stream-centosplus
- CentOS-Stream-PowerTools
# Waiting for the allowerasing args to dnf module, landing in ansible 2.10
- name: Switch to centos-linux-repos
shell: rpm -q centos-linux-repos || dnf install centos-linux-repos -y --allowerasing
args:
warn: False
changed_when: False
tags: repo
- when: repo_centos_stream
block:
- name: Check if stream variable is set
copy: content={{ item.content }} dest={{ item.dest }}
loop:
- content: "{{ ansible_distribution_major_version }}-stream"
dest: /etc/dnf/vars/stream
- name: Configure repositories
yum_repository:
file: "{{ item.file }}"
description: "CentOS {{ item.name }}"
name: "{{ item.name }}"
baseurl: http://mirror.centos.org/$contentdir/$stream/{{ item.dir }}/$basearch/os/
gpgcheck: True
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
loop:
- name: baseos
file: CentOS-Stream-BaseOS
dir: BaseOS
- name: appstream
file: CentOS-Stream-AppStream
dir: AppStream
- name: extras
file: CentOS-Stream-Extras
dir: extras
- name: powertools
file: CentOS-Stream-PowerTools
dir: PowerTools
- name: Remove Base file
file: path=/etc/yum.repos.d/{{ item }}.repo state=absent
loop:
- CentOS-Linux-AppStream
- CentOS-Linux-BaseOS
- CentOS-Linux-ContinuousRelease
- CentOS-Linux-Debuginfo
- CentOS-Linux-Devel
- CentOS-Linux-Extras
- CentOS-Linux-FastTrack
- CentOS-Linux-centosplus
- CentOS-Linux-PowerTools
# Waiting for the allowerasing args to dnf module, landing in ansible 2.10
- name: Switch to centos-stream-repos
shell: rpm -q centos-stream-repos || dnf install centos-stream-repos -y --allowerasing
args:
warn: False
changed_when: False
tags: repo tags: repo
- name: Remove Base file - name: Remove old repo files
file: path=/etc/yum.repos.d/{{ item }}.repo state=absent file: path=/etc/yum.repos.d/{{ item }}.repo state=absent
loop: loop:
- CentOS-Base # Replaced with CentOS-BaseOS - CentOS-Base
- CentOS-CR # Replaced with CentOS-cr - CentOS-CR
- CentOS-Extras # Replaced with CentOS-extras - CentOS-Extras
- CentOS-BaseOS # Replaced with CentOS-Linux-BaseOS - CentOS-BaseOS
- CentOS-AppStream # Replaced with CentOS-Linux-AppStream - CentOS-AppStream
- CentOS-PowerTools # Replaced with CentOS-Linux-PowerTools - CentOS-PowerTools
- CentOS-centosplus # Replaced with CentOS-Linux-Plus - CentOS-centosplus
- CentOS-cr # Replaced with CentOS-Linux-ContinuousRelease - CentOS-cr
- CentOS-extras # Replaced with CentOS-Linux-Extras - CentOS-extras
- CentOS-fasttrack # Replaced with CentOS-Linux-FastTrack - CentOS-fasttrack
tags: repo tags: repo

Loading…
Cancel
Save