From 2f6da128dcc24894e10799124346dd261237ed01 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: May 07 2023 19:55:48 +0000 Subject: Merge branch 'sles15' into 'production' Support SLES 15 See merge request infra/salt!623 --- diff --git a/bin/test_extension.sh b/bin/test_extension.sh index 240d706..83c2a9c 100755 --- a/bin/test_extension.sh +++ b/bin/test_extension.sh @@ -1,6 +1,6 @@ #!/bin/bash -NON_SLS_PILLAR=$(find pillar -type f | egrep -v "(macros.jinja|(FORMULAS|valid_custom_grains)\.yaml|\.sls)$|/README\.md$") +NON_SLS_PILLAR=$(find pillar -type f | egrep -v "(macros.jinja|(FORMULAS|valid_custom_grains)\.yaml|\.sls)$|/README\.md|/map\.j2$") NON_SLS_SALT=$(find salt -type f | egrep -v "/(files|templates)/|(pillar\.example|\.sls|/README\.md)$|/(_modules|_states)/\w+\.py$") NON_SLS=( ${NON_SLS_PILLAR} ${NON_SLS_SALT} ) diff --git a/pillar/osfullname/SLES/12.sls b/pillar/osfullname/SLES/12.sls index 580f924..f991d45 100644 --- a/pillar/osfullname/SLES/12.sls +++ b/pillar/osfullname/SLES/12.sls @@ -1,9 +1,4 @@ -{% set osrelease_info = salt['grains.get']('osrelease_info') %} - -{% set version = osrelease_info[0]|string %} -{% if osrelease_info|length == 2 %} - {% set version = version + '-SP' + osrelease_info[1]|string %} -{% endif %} +{%- from slspath ~ '/map.j2' import version -%} zypper: repositories: diff --git a/pillar/osfullname/SLES/15.sls b/pillar/osfullname/SLES/15.sls new file mode 100644 index 0000000..87a9a15 --- /dev/null +++ b/pillar/osfullname/SLES/15.sls @@ -0,0 +1,20 @@ +{%- from slspath ~ '/map.j2' import version, osarch -%} + +zypper: + repositories: + SLE-Module-Basesystem-POOL: + baseurl: http://smt-internal.infra.opensuse.org/repo/$RCE/SUSE/Products/SLE-Module-Basesystem/{{ version }}/{{ osarch }}/product/ + priority: 99 + refresh: False + SLE-Module-Basesystem-UPDATES: + baseurl: http://smt-internal.infra.opensuse.org/repo/$RCE/SUSE/Updates/SLE-Module-Basesystem/{{ version }}/{{ osarch }}/update/ + priority: 99 + refresh: True + SLE-Product-SLES-POOL: + baseurl: http://smt-internal.infra.opensuse.org/repo/$RCE/SUSE/Products/SLE-Product-SLES/{{ version }}/{{ osarch }}/product/ + priority: 99 + refresh: False + SLE-Product-SLES-UPDATES: + baseurl: http://smt-internal.infra.opensuse.org/repo/$RCE/SUSE/Updates/SLE-Product-SLES/{{ version }}/{{ osarch }}/update/ + priority: 99 + refresh: True diff --git a/pillar/osfullname/SLES/map.j2 b/pillar/osfullname/SLES/map.j2 new file mode 100644 index 0000000..1c4cfdd --- /dev/null +++ b/pillar/osfullname/SLES/map.j2 @@ -0,0 +1,6 @@ +{%- set osrelease_info = salt['grains.get']('osrelease_info') -%} +{%- set osarch = salt['grains.get']('osarch') -%} +{%- set version = osrelease_info[0]|string -%} +{%- if osrelease_info|length == 2 -%} + {%- set version = version + '-SP' + osrelease_info[1]|string -%} +{%- endif %} diff --git a/pillar/salt_cluster/opensuse/osfullname/SLES.sls b/pillar/salt_cluster/opensuse/osfullname/SLES.sls index be3d653..4fb9d9f 100644 --- a/pillar/salt_cluster/opensuse/osfullname/SLES.sls +++ b/pillar/salt_cluster/opensuse/osfullname/SLES.sls @@ -1,14 +1,19 @@ {% set osrelease_info = salt['grains.get']('osrelease_info') %} +{%- if osrelease_info[0] < 15 %} {% set version = osrelease_info[0]|string %} {% if osrelease_info|length == 2 %} {% set version = version + '_SP' + osrelease_info[1]|string %} +{%- endif %} +{%- set repo_version = 'SLE_' ~ version %} +{%- else %} +{%- set repo_version = salt['grains.get']('osrelease') %} {% endif %} zypper: repositories: openSUSE:infrastructure: - baseurl: https://download.infra.opensuse.org/repositories/openSUSE:/infrastructure/SLE_{{ version }}/ + baseurl: https://download.infra.opensuse.org/repositories/openSUSE:/infrastructure/{{ repo_version }}/ gpgautoimport: True priority: 100 refresh: True