From: Frank Brehm Date: Mon, 29 Jun 2020 08:44:03 +0000 (+0200) Subject: Adding and using snippets/tpl.170.repos_el7.sh and snippets/tpl.170.repos_oel7.sh X-Git-Tag: 2.1.2^2~5^2~3^2~4 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=c58948d5e2cd715027d1ed401759c7317356dceb;p=pixelpark%2Fcreate-vmware-tpl.git Adding and using snippets/tpl.170.repos_el7.sh and snippets/tpl.170.repos_oel7.sh --- diff --git a/files/repos-el7/puppet.repo b/files/repos-el7/puppet.repo index 0394956..909d121 100644 --- a/files/repos-el7/puppet.repo +++ b/files/repos-el7/puppet.repo @@ -2,8 +2,8 @@ # [puppet] -name=Puppet Repository el $releasever - $basearch -baseurl=https://repo01.pixelpark.com/Linux/yum/puppetlabs/puppet5/el/$releasever/$basearch +name=Puppet Repository el 7 - $basearch +baseurl=https://repo01.pixelpark.com/Linux/yum/puppetlabs/puppet5/el/7/$basearch gpgkey=https://repo01.pixelpark.com/Linux/yum/puppetlabs/RPM-GPG-KEY-puppet enabled=1 gpgcheck=1 diff --git a/files/repos-oel7/ol7_addons.repo b/files/repos-oel7/ol7_addons.repo index 28376bc..1328f39 100644 --- a/files/repos-oel7/ol7_addons.repo +++ b/files/repos-oel7/ol7_addons.repo @@ -3,5 +3,6 @@ name=Oracle Linux $releasever Add ons ($basearch) baseurl=https://repo01.pixelpark.com/Linux/yum/OracleLinux/OL7/ol7_addons/ enabled=1 gpgcheck=1 +gpgkey=https://repo01.pixelpark.com/Linux/yum/OracleLinux/OL7/RPM-GPG-KEY-oracle # vim: filetype=dosini diff --git a/kickstart/template-oel7.ks b/kickstart/template-oel7.ks index a8ae643..3601c78 100644 --- a/kickstart/template-oel7.ks +++ b/kickstart/template-oel7.ks @@ -196,10 +196,15 @@ echo echo "Using snippet $clear_repos_snippet" $SNIPPET($clear_repos_snippet) -## #set $get_repos_snippet = "per_status/" + $SYSTEM_STATUS + "/tpl.170.repos_oel7.sh" -## echo -## echo "Using snippet $get_repos_snippet" -## $SNIPPET($get_repos_snippet) +#set $get_repos_oel_snippet = "per_status/" + $SYSTEM_STATUS + "/tpl.170.repos_oel7.sh" +echo +echo "Using snippet $get_repos_oel_snippet" +$SNIPPET($get_repos_oel_snippet) + +#set $get_repos_el_snippet = "per_status/" + $SYSTEM_STATUS + "/tpl.170.repos_el7.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/snippets/tpl.170.repos_el7.sh b/snippets/tpl.170.repos_el7.sh new file mode 100644 index 0000000..cb800a3 --- /dev/null +++ b/snippets/tpl.170.repos_el7.sh @@ -0,0 +1,32 @@ +## !/bin/bash +#raw + +#----------------------------------------------------------- +get_repos_el7() { + + echo + echo "${HASH_LINE}" + echo "Calling get_repos_el7() ..." + echo + local base_url="${COBBLER_URL}/${ws_rel_filesdir}/${system_status}/repos/el7" + + local -a repos=('epel' 'icinga' 'pixelpark' 'prometheus' 'puppet' 'wazuh') + + 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_el7 + +#end raw diff --git a/snippets/tpl.170.repos_oel7.sh b/snippets/tpl.170.repos_oel7.sh new file mode 100644 index 0000000..6582aff --- /dev/null +++ b/snippets/tpl.170.repos_oel7.sh @@ -0,0 +1,32 @@ +## !/bin/bash +#raw + +#----------------------------------------------------------- +get_repos_centos7() { + + echo + echo "${HASH_LINE}" + echo "Calling get_repos_centos7() ..." + echo + local base_url="${COBBLER_URL}/${ws_rel_filesdir}/${system_status}/repos/centos7" + + local -a repos=('ol7_addons' 'ol7_latest' 'ol7_optional_latest') + + 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_centos7 + +#end raw