]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
testnode: No pkg tasks before repos are set up 687/head
authorDavid Galloway <dgallowa@redhat.com>
Tue, 28 Jun 2022 16:27:32 +0000 (12:27 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Tue, 28 Jun 2022 16:32:35 +0000 (12:32 -0400)
Newer versions of RHEL8 don't like having yum called if they don't have repos setup.

When a RHEL8 machine gets provisioned via Cobbler, we zap the disks before we register the server to Satellite (or CDN).

We don't really need to check if gdisk and device-mapper are installed during a Cobbler install because we know they're installed in https://github.com/ceph/ceph-cm-ansible/blob/main/roles/cobbler/templates/snippets/cephlab_packages_rhel

Signed-off-by: David Galloway <dgallowa@redhat.com>
roles/testnode/tasks/zap_disks.yml

index 22ed9a84301b326d1169e4d4450b7bc7340f9664..a56f41fd490ec44664c982d0e35215c639cdb490 100644 (file)
@@ -13,7 +13,8 @@
   package:
     name: ['gdisk', 'device-mapper']
     state: present
-  when: ansible_os_family == "RedHat"
+  when: (ansible_distribution == "RedHat" and rhsm_registered is defined and rhsm_registered == true) or
+        (ansible_os_family == "RedHat" and ansible_distribution != "RedHat")
 
 - name: Set root disk
   set_fact: