From 59c255dc2f69b062dc0f9c9f62723ecf2b918116 Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Apr 13 2024 13:53:03 +0000 Subject: Remove duplicate distribution repository New physical machines are installed with a "openSUSE-Leap--" repository pointing to distribution/leap//repo/oss/. We already manage this path with a repository named "repo-oss" in pillar.osfullname.Leap - ensure the unmanaged duplicate gets removed. Signed-off-by: Georg Pfuetzenreuter --- diff --git a/salt/profile/legacy.sls b/salt/profile/legacy.sls index 68dce98..800d770 100644 --- a/salt/profile/legacy.sls +++ b/salt/profile/legacy.sls @@ -22,3 +22,13 @@ remove_decommissioned_packages: - hdparm - mdadm {%- endif %} + +{%- if grains['osfullname'] == 'Leap' %} +{#- remove stock "openSUSE-Leap-15.x-x" repositories duplicating the pillar.osfullname managed repo-oss #} +{%- for repository_file in salt['file.find']('/etc/zypp/repos.d', maxdepth=1, mindepth=1, name='*.repo', type='f') %} +{%- if 'openSUSE-Leap-' in repository_file %} +{{ repository_file }}: + file.absent +{%- endif %} +{%- endfor %} +{%- endif %}