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. 139
      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
- when: not repo_centos_stream
block:
- name: Configure repositories
yum_repository: yum_repository:
file: CentOS-Linux-{{ item.name }} file: "{{ item.file }}"
description: "Centos - {{ item.name }}" description: "CentOS {{ item.name }}"
name: "{{ item.name | lower }}" name: "{{ item.name }}"
baseurl: http://mirror.centos.org/$contentdir/$releasever/{{ item.repo }}/$basearch/os/ baseurl: http://mirror.centos.org/$contentdir/$releasever/{{ item.dir }}/$basearch/os/
gpgcheck: True gpgcheck: True
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
enabled: "{{ item.enabled | default(True) }}"
loop: loop:
- name: BaseOS - name: baseos
repo: BaseOS file: CentOS-Linux-Base
- name: AppStream dir: BaseOS
repo: AppStream - name: appstream
- name: PowerTools file: CentOS-Linux-AppStream
repo: PowerTools dir: AppStream
- name: Extras - name: plus
repo: extras file: CentOS-Linux-Plus
- name: ContinuousRelease dir: centosplus
repo: cr - name: extras
enabled: False file: CentOS-Linux-Extras
- name: Plus dir: extras
repo: centosplus - name: powertools
enabled: False file: CentOS-Linux-PowerTools
- name: FastTrack dir: PowerTools
repo: fasttrack
enabled: False - 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 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 - name: Remove Base file
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-Linux-AppStream
- CentOS-CR # Replaced with CentOS-cr - CentOS-Linux-BaseOS
- CentOS-Extras # Replaced with CentOS-extras - CentOS-Linux-ContinuousRelease
- CentOS-BaseOS # Replaced with CentOS-Linux-BaseOS - CentOS-Linux-Debuginfo
- CentOS-AppStream # Replaced with CentOS-Linux-AppStream - CentOS-Linux-Devel
- CentOS-PowerTools # Replaced with CentOS-Linux-PowerTools - CentOS-Linux-Extras
- CentOS-centosplus # Replaced with CentOS-Linux-Plus - CentOS-Linux-FastTrack
- CentOS-cr # Replaced with CentOS-Linux-ContinuousRelease - CentOS-Linux-centosplus
- CentOS-extras # Replaced with CentOS-Linux-Extras - CentOS-Linux-PowerTools
- CentOS-fasttrack # Replaced with CentOS-Linux-FastTrack
# 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
- name: Remove old repo files
file: path=/etc/yum.repos.d/{{ item }}.repo state=absent
loop:
- CentOS-Base
- CentOS-CR
- CentOS-Extras
- CentOS-BaseOS
- CentOS-AppStream
- CentOS-PowerTools
- CentOS-centosplus
- CentOS-cr
- CentOS-extras
- CentOS-fasttrack
tags: repo tags: repo

Loading…
Cancel
Save