From c2c5b081548e8626b84fae04d3de414804063ee0 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Thu, 30 Jun 2022 14:11:22 +0200 Subject: [PATCH] Adding and changing snippets for installing repo definition files --- ....170.repos_el7.sh => tpl.175.repos_el7.sh} | 0 snippets/tpl.180.repos_almalinux8.sh | 33 ++++++++++++++++++ snippets/tpl.180.repos_centos8.sh | 4 +-- snippets/tpl.180.repos_rocky8.sh | 33 ++++++++++++++++++ ....181.repos_el8.sh => tpl.185.repos_el8.sh} | 0 snippets/tpl.190.repos_almalinux9.sh | 34 +++++++++++++++++++ snippets/tpl.190.repos_centos9.sh | 32 +++++++++++++++++ 7 files changed, 134 insertions(+), 2 deletions(-) rename snippets/{tpl.170.repos_el7.sh => tpl.175.repos_el7.sh} (100%) create mode 100644 snippets/tpl.180.repos_almalinux8.sh create mode 100644 snippets/tpl.180.repos_rocky8.sh rename snippets/{tpl.181.repos_el8.sh => tpl.185.repos_el8.sh} (100%) create mode 100644 snippets/tpl.190.repos_almalinux9.sh create mode 100644 snippets/tpl.190.repos_centos9.sh diff --git a/snippets/tpl.170.repos_el7.sh b/snippets/tpl.175.repos_el7.sh similarity index 100% rename from snippets/tpl.170.repos_el7.sh rename to snippets/tpl.175.repos_el7.sh diff --git a/snippets/tpl.180.repos_almalinux8.sh b/snippets/tpl.180.repos_almalinux8.sh new file mode 100644 index 0000000..5c8db96 --- /dev/null +++ b/snippets/tpl.180.repos_almalinux8.sh @@ -0,0 +1,33 @@ +## !/bin/bash +#raw + +#----------------------------------------------------------- +get_repos_almalinux8() { + + echo + echo "${HASH_LINE}" + echo "Calling get_repos_repos_almalinux8() ..." + echo + local base_url="${COBBLER_URL}/${ws_rel_filesdir}/${system_status}/repos/alma8" + + local -a repos=('almalinux' 'almalinux-ha' 'almalinux-nft' 'almalinux-plus') + repos+=('almalinux-powertools' 'almalinux-resilientstorage' 'almalinux-rt') + + 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_almalinux8 + +#end raw diff --git a/snippets/tpl.180.repos_centos8.sh b/snippets/tpl.180.repos_centos8.sh index 4fdebd2..1b96d4c 100644 --- a/snippets/tpl.180.repos_centos8.sh +++ b/snippets/tpl.180.repos_centos8.sh @@ -10,8 +10,8 @@ get_repos_centos8() { echo local base_url="${COBBLER_URL}/${ws_rel_filesdir}/${system_status}/repos/centos8" - local -a repos=('CentOS-AppStream' 'CentOS-Base' 'CentOS-centosplus' 'CentOS-CR' 'CentOS-Devel') - repos+=('CentOS-Extras' 'CentOS-fasttrack' 'CentOS-HA' 'CentOS-PowerTools') + local -a repos=('CentOS-Stream-AppStream' 'CentOS-Stream-BaseOS' 'CentOS-Stream-Extras-common' 'CentOS-Stream-Extras') + repos+=('CentOS-Stream-HighAvailability' 'CentOS-Stream-NFV' 'CentOS-Stream-PowerTools' 'CentOS-Stream-ResilientStorage') local repo= local url= diff --git a/snippets/tpl.180.repos_rocky8.sh b/snippets/tpl.180.repos_rocky8.sh new file mode 100644 index 0000000..6a857d6 --- /dev/null +++ b/snippets/tpl.180.repos_rocky8.sh @@ -0,0 +1,33 @@ +## !/bin/bash +#raw + +#----------------------------------------------------------- +get_repos_rocky8() { + + echo + echo "${HASH_LINE}" + echo "Calling get_repos_rocky8() ..." + echo + local base_url="${COBBLER_URL}/${ws_rel_filesdir}/${system_status}/repos/rocky8" + + local -a repos=('Rocky-AppStream' 'Rocky-BaseOS' 'Rocky-Extras' 'Rocky-HighAvailability') + repos+=('Rocky-NFV' 'Rocky-Plus' 'Rocky-PowerTools' 'Rocky-ResilientStorage' 'Rocky-RT') + + 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_rocky8 + +#end raw diff --git a/snippets/tpl.181.repos_el8.sh b/snippets/tpl.185.repos_el8.sh similarity index 100% rename from snippets/tpl.181.repos_el8.sh rename to snippets/tpl.185.repos_el8.sh diff --git a/snippets/tpl.190.repos_almalinux9.sh b/snippets/tpl.190.repos_almalinux9.sh new file mode 100644 index 0000000..71027b1 --- /dev/null +++ b/snippets/tpl.190.repos_almalinux9.sh @@ -0,0 +1,34 @@ +## !/bin/bash +#raw + +#----------------------------------------------------------- +get_repos_almalinux9() { + + echo + echo "${HASH_LINE}" + echo "Calling get_repos_repos_almalinux9() ..." + echo + local base_url="${COBBLER_URL}/${ws_rel_filesdir}/${system_status}/repos/alma9" + + local -a repos=('almalinux-appstream' 'almalinux-baseos' 'almalinux-crb' 'almalinux-extras' ) + repos+=('almalinux-highavailability' 'almalinux-nfv' 'almalinux-plus') + repos+=('almalinux-resilientstorage' 'almalinux-rt' 'almalinux-sap' 'almalinux-saphana') + + 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_almalinux9 + +#end raw diff --git a/snippets/tpl.190.repos_centos9.sh b/snippets/tpl.190.repos_centos9.sh new file mode 100644 index 0000000..0132d97 --- /dev/null +++ b/snippets/tpl.190.repos_centos9.sh @@ -0,0 +1,32 @@ +## !/bin/bash +#raw + +#----------------------------------------------------------- +get_repos_centos9() { + + echo + echo "${HASH_LINE}" + echo "Calling get_repos_centos9() ..." + echo + local base_url="${COBBLER_URL}/${ws_rel_filesdir}/${system_status}/repos/centos9" + + local -a repos=('centos' 'centos-addons') + + 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_centos9 + +#end raw -- 2.39.5