From 4e229a02efacc913310e36d1fcc8a559527bd540 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Tue, 7 Jun 2022 13:16:02 +0200 Subject: [PATCH] Splitting repos for CentOS8 into pure CentOS8 and common EL8 repos --- files/{repos-centos8 => repos-el8}/epel.repo | 0 .../{repos-centos8 => repos-el8}/icinga.repo | 0 .../pixelpark.repo | 0 .../prometheus.repo | 0 .../{repos-centos8 => repos-el8}/puppet.repo | 0 kickstart/template-centos8.ks | 11 +++++-- lib/cr_vmware_tpl/__init__.py | 2 +- snippets/tpl.180.repos_centos8.sh | 1 - snippets/tpl.181.repos_el8.sh | 32 +++++++++++++++++++ 9 files changed, 41 insertions(+), 5 deletions(-) rename files/{repos-centos8 => repos-el8}/epel.repo (100%) rename files/{repos-centos8 => repos-el8}/icinga.repo (100%) rename files/{repos-centos8 => repos-el8}/pixelpark.repo (100%) rename files/{repos-centos8 => repos-el8}/prometheus.repo (100%) rename files/{repos-centos8 => repos-el8}/puppet.repo (100%) create mode 100644 snippets/tpl.181.repos_el8.sh diff --git a/files/repos-centos8/epel.repo b/files/repos-el8/epel.repo similarity index 100% rename from files/repos-centos8/epel.repo rename to files/repos-el8/epel.repo diff --git a/files/repos-centos8/icinga.repo b/files/repos-el8/icinga.repo similarity index 100% rename from files/repos-centos8/icinga.repo rename to files/repos-el8/icinga.repo diff --git a/files/repos-centos8/pixelpark.repo b/files/repos-el8/pixelpark.repo similarity index 100% rename from files/repos-centos8/pixelpark.repo rename to files/repos-el8/pixelpark.repo diff --git a/files/repos-centos8/prometheus.repo b/files/repos-el8/prometheus.repo similarity index 100% rename from files/repos-centos8/prometheus.repo rename to files/repos-el8/prometheus.repo diff --git a/files/repos-centos8/puppet.repo b/files/repos-el8/puppet.repo similarity index 100% rename from files/repos-centos8/puppet.repo rename to files/repos-el8/puppet.repo diff --git a/kickstart/template-centos8.ks b/kickstart/template-centos8.ks index f956e0a..fab998a 100644 --- a/kickstart/template-centos8.ks +++ b/kickstart/template-centos8.ks @@ -210,10 +210,15 @@ echo echo "Using snippet $clear_repos_snippet" $SNIPPET($clear_repos_snippet) -#set $get_repos_snippet = "per_status/" + $SYSTEM_STATUS + "/tpl.180.repos_centos8.sh" +#set $get_repos_centos_snippet = "per_status/" + $SYSTEM_STATUS + "/tpl.180.repos_centos8.sh" echo -echo "Using snippet $get_repos_snippet" -$SNIPPET($get_repos_snippet) +echo "Using snippet $get_repos_centos_snippet" +$SNIPPET($get_repos_centos_snippet) + +#set $get_repos_el_snippet = "per_status/" + $SYSTEM_STATUS + "/tpl.181.repos_el8.sh" +echo +echo "Using snippet $get_repos_el_snippet" +$SNIPPET($get_repos_el_snippet) #set $init_repos_snippet = "per_status/" + $SYSTEM_STATUS + "/tpl.200.init-repos.sh" echo diff --git a/lib/cr_vmware_tpl/__init__.py b/lib/cr_vmware_tpl/__init__.py index 3151388..6cdf0b0 100644 --- a/lib/cr_vmware_tpl/__init__.py +++ b/lib/cr_vmware_tpl/__init__.py @@ -3,7 +3,7 @@ import time -__version__ = '2.3.6' +__version__ = '2.4.0' # ------------------------------------------------------------------------- diff --git a/snippets/tpl.180.repos_centos8.sh b/snippets/tpl.180.repos_centos8.sh index ee1e161..4fdebd2 100644 --- a/snippets/tpl.180.repos_centos8.sh +++ b/snippets/tpl.180.repos_centos8.sh @@ -12,7 +12,6 @@ get_repos_centos8() { local -a repos=('CentOS-AppStream' 'CentOS-Base' 'CentOS-centosplus' 'CentOS-CR' 'CentOS-Devel') repos+=('CentOS-Extras' 'CentOS-fasttrack' 'CentOS-HA' 'CentOS-PowerTools') - repos+=('epel' 'icinga' 'pixelpark' 'prometheus' 'puppet') local repo= local url= diff --git a/snippets/tpl.181.repos_el8.sh b/snippets/tpl.181.repos_el8.sh new file mode 100644 index 0000000..0473cde --- /dev/null +++ b/snippets/tpl.181.repos_el8.sh @@ -0,0 +1,32 @@ +## !/bin/bash +#raw + +#----------------------------------------------------------- +get_repos_el8() { + + echo + echo "${HASH_LINE}" + echo "Calling get_repos_el8() ..." + echo + local base_url="${COBBLER_URL}/${ws_rel_filesdir}/${system_status}/repos/el8" + + local -a repos=('epel' 'icinga' 'pixelpark' 'prometheus' 'puppet') + + local repo= + local url= + local tmp_file= + for repo in "${repos[@]}" ; do + echo "Ensuring repo '${repo}.repo'..." + url="${base_url}/${repo}.repo" + tmp_file=$( mktemp ) + wget -O "${tmp_file}" --dns-timeout=2 --connect-timeout=3 --read-timeout=3 "${url}" || true + if [[ -s "${tmp_file}" ]] ; then + mv -v "${tmp_file}" "/etc/yum.repos.d/${repo}.repo" + fi + rm -fv "${tmp_file}" + done + +} +get_repos_el8 + +#end raw -- 2.39.5