From: Frank Brehm Date: Thu, 30 Jun 2022 12:24:20 +0000 (+0200) Subject: Adding snippet for installing repo definition files X-Git-Tag: 2.6.2~1^2~8^2~20 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=9f89c37558b24d6ddd18d0e7fca606c0b59043bc;p=pixelpark%2Fcreate-vmware-tpl.git Adding snippet for installing repo definition files --- diff --git a/snippets/tpl.195.repos_el9.sh b/snippets/tpl.195.repos_el9.sh new file mode 100644 index 0000000..a106b54 --- /dev/null +++ b/snippets/tpl.195.repos_el9.sh @@ -0,0 +1,32 @@ +## !/bin/bash +#raw + +#----------------------------------------------------------- +get_repos_el9() { + + echo + echo "${HASH_LINE}" + echo "Calling get_repos_el9() ..." + echo + local base_url="${COBBLER_URL}/${ws_rel_filesdir}/${system_status}/repos/el9" + + local -a repos=('pixelpark' '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_el9 + +#end raw