]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
builder.yml: fix libvirt-devel install on CentOS 9
authorjitendrasahu1803 <jitendra.sahu1803@gmail.com>
Tue, 14 Jul 2026 07:49:16 +0000 (13:19 +0530)
committerjitendrasahu1803 <jitendra.sahu1803@gmail.com>
Tue, 14 Jul 2026 07:49:16 +0000 (13:19 +0530)
ansible/examples/builder.yml

index 9d039a2b0a536fe84fc39b8ed636710be7aaa4dc..d4ec092a12e0192786e66001c50e16c573519dd1 100644 (file)
         - ansible_os_family == "RedHat"
         - ansible_distribution_major_version|int <= 8
 
+     # Install common RedHat packages separately from libvirt packages.
+     # On EL9, some libvirt packages such as libvirt-devel are available from CRB.
+     # Keeping libvirt packages in a separate task lets us enable CRB only when needed.   
     - name: Install RPMs without EPEL
       yum:
-        name: "{{ universal_rpms + libvirt_rpms|default([]) + lsb_package|default([]) }}"
+        name: "{{ universal_rpms + lsb_package|default([]) }}"
         state: present
         disablerepo: epel
       when: ansible_os_family == "RedHat"
+   
+    # EL7/EL8 existing behavior is kept unchanged.
+    # These releases did not need the  EL9-specific CRB handling for libvirt packages.  
+    - name: Install Libvirt RPMs without EPEL
+      yum:
+        name: "{{ libvirt_rpms|default([]) }}"
+        state: present
+        disablerepo: epel
+      when:
+        - ansible_os_family == "RedHat"
+        - ansible_distribution_major_version|int <= 8
+        - libvirt|bool
+
+    # Keep common RPM installation separate from libvirt RPMs.
+    # EL9 needs CRB enabled for libvirt-devel, so libvirt packages are handled separately.    
+    - name: Install Libvirt RPMs with CRB
+      yum:
+        name: "{{ libvirt_rpms|default([]) }}"
+        state: present
+        enablerepo: crb
+      when:
+        - ansible_os_family == "RedHat"
+        - ansible_distribution_major_version|int == 9
+        - libvirt|bool  
 
     - name: Install RPMs with EPEL,CRB
       yum: