Skip to content

Commit b7e3017

Browse files
authored
Merge pull request #198 from AlmaLinux/el7_tweaks
Disable CentOS 7 repos for specific packages
2 parents bcba5ca + 8cb1924 commit b7e3017

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
el7_disablerepo_pkg_prefixes:
3+
- grub
4+
el7_disablerepo_repos:
5+
- centos-7-os
6+
- centos-7-updates

resources/roles/install_uninstall/tasks/main.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,19 @@
1818
is_ea_apache24_mod_lsapi: "{{ pkg_name.startswith('ea-apache24-mod-lsapi') }}"
1919
is_ea_apache24_mod_cgid: "{{ pkg_name.startswith('ea-apache24-mod_cgid') }}"
2020
is_ea_apache24_mod_http2: "{{ pkg_name.startswith('ea-apache24-mod_http2') }}"
21-
dnf_args: "{{ default_dnf_args | combine(extra_dnf_args) }}"
21+
dnf_args: "{{ default_dnf_args | combine(extra_dnf_args) | combine(disablerepo_args) }}"
2222
apt_args:
2323
allow_unauthenticated: true
2424
vars:
2525
default_dnf_args:
2626
allow_downgrade: true
2727
lock_timeout: 300
2828
extra_dnf_args: "{{ { 'allowerasing': true } if ansible_facts.distribution_major_version | int >= 8 else {} }}"
29+
_is_el7_disablerepo_pkg: >-
30+
{{ ansible_facts.distribution_major_version == '7'
31+
and el7_disablerepo_pkg_prefixes | default([]) | length > 0
32+
and pkg_name | regex_search('^(' + el7_disablerepo_pkg_prefixes | join('|') + ')') is not none }}
33+
disablerepo_args: "{{ {'disablerepo': el7_disablerepo_repos | join(',')} if _is_el7_disablerepo_pkg else {} }}"
2934
tags:
3035
- install_package
3136

0 commit comments

Comments
 (0)