``enable_epel`` is a boolean that sets whether epel repos should be enabled.
Defined in ``roles/common/defaults/main.yml``.
+``beta_repos`` is a dict of internal Red Hat beta repos used to create repo files in /etc/yum.repos.d. We have these defined in the secrets repo. See ``epel_repos`` for dict syntax.
+
``yum_timeout`` is an integer used to set the yum timeout. Defined in
``roles/common/defaults/main.yml``.
enabled: 0
gpgcheck: 0
+# Override in secrets repo
+beta_repos: []
+
+# Default to false. A task in roles/common/tasks/yum_systems.yml
+# will set this to true if lsb_release indicates the distro is an Alpha/Beta release
+beta_distro: false
+
enable_epel: true
yum_timeout: 300
--- /dev/null
+---
+- name: Configure internal beta repos in /etc/yum.repos.d/
+ template:
+ src: yum_repo.j2
+ dest: /etc/yum.repos.d/{{ item.key }}.repo
+ owner: root
+ group: root
+ mode: 0644
+ register: beta_repo
+ with_dict: "{{ beta_repos }}"
+ no_log: true
+
+- name: Clean yum cache
+ shell: yum clean all
+ when: beta_repo is defined and beta_repo|changed
state: present
when: ansible_distribution == 'Fedora' and ansible_distribution_major_version|int >= 22
+- name: Determine if distro is a Beta or Alpha release
+ set_fact:
+ beta_distro: true
+ when:
+ ansible_distribution == 'RedHat' and
+ ('Beta' in ansible_lsb.description or
+ 'Alpha' in ansible_lsb.description)
+
+# include internal repos when distro is a Beta or Alpha release
+- include: beta_repos.yml
+ when:
+ ansible_distribution == 'RedHat' and
+ beta_distro == true
+ tags:
+ - repos
+
# configure Red Hat entitlements with subscription-manager
- include: rhel-entitlements.yml
- when: ansible_distribution == 'RedHat'
+ when:
+ ansible_distribution == 'RedHat' and
+ beta_distro == false
tags:
- entitlements