Skip to content

Commit

Permalink
fix: remove built in appstream repo from image
Browse files Browse the repository at this point in the history
  • Loading branch information
shalin patel committed Feb 1, 2022
1 parent 7c617cd commit 66eef33
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 26 deletions.
60 changes: 35 additions & 25 deletions ansible/roles/packages/tasks/repo-redhat.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,42 @@
---
# The EPEL repo for Centos 8 is deperacated.
# AlmaLinux is 1:1 binary compatible with RHEL and subscription free.
# Alma linux's extra repository symlinks epel repository rpms. https://wiki.almalinux.org/repos/AlmaLinux.html
# Why not RHEL repo?: RHEL is RHEL though the free subscription expires once a year.
# it cannot be renewed until it does expire and then you have to re-register your systems to pick up the new subscription.
# Also RHEL repos are missing some python3 rpms that we need.
- name: Add Alma linux extra repository
yum_repository:
name: alma-linux-extra
description: Extra repository for alma linux
file: almalinux
baseurl: https://repo.almalinux.org/almalinux/$releasever/extras/$basearch/os/
mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/extras
enabled: yes
gpgkey: https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux
gpgcheck: yes
when:
- not offline_mode_enabled
- ansible_distribution_major_version == '8'

# The correct epel-release rpms will be downloaded for Centos, RHEL and oracle 7 repos from in-built extra repos
# epel-release for Centos/RHEL/Oracle 8 will be installed using Alma linux "extra" repository
- name: install epel-release
yum:
name: epel-release
state: present
- name: install epel-repository
when:
- not offline_mode_enabled
block:
- name: Remove appstream repository
yum_repository:
name: appstream
state: absent
ignore_errors: True
when:
- ansible_distribution_major_version == '8'

# The AppStream repo for Centos 8 is not available from centos mirror list.
# AlmaLinux is 1:1 binary compatible with RHEL and subscription free.
# Alma linux's extra repository symlinks epel repository rpms. https://wiki.almalinux.org/repos/AlmaLinux.html
# Why not RHEL repo?: RHEL is RHEL though the free subscription expires once a year.
# it cannot be renewed until it does expire and then you have to re-register your systems to pick up the new subscription.
# Also RHEL repos are missing some python3 rpms that we need.
- name: Add Alma linux extra repository
yum_repository:
name: alma-linux-extra
description: Extra repository for alma linux
file: almalinux
baseurl: https://repo.almalinux.org/almalinux/$releasever/extras/$basearch/os/
mirrorlist: https://mirrors.almalinux.org/mirrorlist/$releasever/extras
enabled: yes
gpgkey: https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux
gpgcheck: yes
when:
- ansible_distribution_major_version == '8'

# The correct epel-release rpms will be downloaded for Centos, RHEL and oracle 7 repos from in-built extra repos
# epel-release for Centos/RHEL/Oracle 8 will be installed using Alma linux "extra" repository
- name: install epel-release
yum:
name: epel-release
state: present

- name: upload offline repository
template:
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/version/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# the build tag.
- name: determine kubernetes images
shell: |
kubeadm config images list --image-repository '{{ k8s_image_registry }}' |
kubeadm config images list --image-repository '{{ kubernetes_semver }}' |
sed 's/^\(.\+etcd:.\+\)-\([0-9]\+\)$/\1{{ "-\2" if not kubernetes_build_tag }}/' |
sed 's/$/{{ '_' + kubernetes_build_tag if kubernetes_build_tag }}/' |
sed 's/^\(.\+pause:.\+\)_{{ kubernetes_build_tag }}$/\1/'
Expand Down

0 comments on commit 66eef33

Please sign in to comment.