Skip to content

Commit

Permalink
Merge pull request #223 from rancherfederal/122-unable-to-modify-exis…
Browse files Browse the repository at this point in the history
…ting-rke2-yum-repos

allow yum repos to be modified
  • Loading branch information
aleiner authored May 22, 2024
2 parents ae6bb9b + 34f32c8 commit 4267ddf
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions roles/rke2_common/tasks/rpm_install.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
---

# Does the Rancher RKE2 Common repo exist already
- name: Check to see if rke2-common.repo exists
ansible.builtin.stat:
path: '/etc/yum.repos.d/rke2-common.repo'
register: stat_rke2_common_repo

# Add RKE2 Common repo if it doesn't exist
# Add RKE2 Common repo
- name: Add the rke2-common repo RHEL/CentOS/Rocky
ansible.builtin.yum_repository:
name: "{{ rke2_common_yum_repo.name }}"
Expand All @@ -16,19 +10,12 @@
gpgkey: "{{ rke2_common_yum_repo.gpgkey }}"
enabled: "{{ rke2_common_yum_repo.enabled }}"
when:
- not stat_rke2_common_repo.stat.exists
- ansible_facts['os_family'] == "RedHat" or ansible_facts['os_family'] == "Rocky"
- ansible_facts['distribution_major_version'] == "7" or
ansible_facts['distribution_major_version'] == "8" or
ansible_facts['distribution_major_version'] == "9"

# Does the Rancher RKE2 versioned repo exist already
- name: Check to see if rke2 versioned repo exists
ansible.builtin.stat:
path: '/etc/yum.repos.d/rke2-v{{ rke2_version_majmin }}.repo'
register: stat_rke2_versioned_repo

# Add RKE2 versioned repo if it doesn't exist
# Add RKE2 versioned repo
- name: Add the rke2 versioned repo CentOS/RHEL/Rocky
ansible.builtin.yum_repository:
name: "{{ rke2_versioned_yum_repo.name }}"
Expand All @@ -38,7 +25,6 @@
gpgkey: "{{ rke2_versioned_yum_repo.gpgkey }}"
enabled: "{{ rke2_versioned_yum_repo.enabled }}"
when:
- not stat_rke2_versioned_repo.stat.exists
- ansible_facts['os_family'] == "RedHat" or ansible_facts['os_family'] == "Rocky"
- ansible_facts['distribution_major_version'] == "7" or
ansible_facts['distribution_major_version'] == "8" or
Expand Down

0 comments on commit 4267ddf

Please sign in to comment.