From 96747e40e18f08fcab18e4b4f9e397221411142e Mon Sep 17 00:00:00 2001 From: jacob Date: Mon, 2 Oct 2023 14:01:38 -0500 Subject: [PATCH] Rolling back some bad/unnecessary changes --- ansible.cfg | 2 +- roles/rke2_common/tasks/rpm_install.yml | 17 +++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/ansible.cfg b/ansible.cfg index 05f5fba8..8570c43b 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -1,7 +1,7 @@ [defaults] nocows = True roles_path = ./roles -inventory = ./inventory/hosts.ini +inventory = ./inventory/my-cluster/hosts.ini remote_tmp = $HOME/.ansible/tmp local_tmp = $HOME/.ansible/tmp diff --git a/roles/rke2_common/tasks/rpm_install.yml b/roles/rke2_common/tasks/rpm_install.yml index 237a73ca..e64badb2 100644 --- a/roles/rke2_common/tasks/rpm_install.yml +++ b/roles/rke2_common/tasks/rpm_install.yml @@ -15,17 +15,10 @@ gpgcheck: "{{ rke2_common_yum_repo.gpgcheck }}" gpgkey: "{{ rke2_common_yum_repo.gpgkey }}" enabled: "{{ rke2_common_yum_repo.enabled }}" - when: not stat_rke2_common_repo.stat.exists and ansible_lsb.major_release == '7' - -- name: Add the rke2-common repo RHEL/CentOS 8 - ansible.builtin.yum_repository: - name: "{{ rke2_common_yum_repo.name }}" - description: "{{ rke2_common_yum_repo.description }}" - baseurl: "{{ rke2_common_yum_repo.baseurl }}" - gpgcheck: "{{ rke2_common_yum_repo.gpgcheck }}" - gpgkey: "{{ rke2_common_yum_repo.gpgkey }}" - enabled: "{{ rke2_common_yum_repo.enabled }}" - when: not stat_rke2_common_repo.stat.exists and ansible_lsb.major_release == '8' + 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" # Does the Rancher RKE2 versioned repo exist already - name: Check to see if rke2 versioned repo exists @@ -63,4 +56,4 @@ when: - ansible_facts['os_family'] == 'RedHat' or ansible_facts['os_family'] == 'Rocky' - not rke2_binary_tarball_check.stat.exists - - inventory_hostname in groups.get('rke2_agents', []) + - inventory_hostname in groups.get('rke2_agents', []) \ No newline at end of file