]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Adding and using snippets/tpl.170.repos_el7.sh and snippets/tpl.170.repos_oel7.sh
authorFrank Brehm <frank.brehm@pixelpark.com>
Mon, 29 Jun 2020 08:44:03 +0000 (10:44 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Mon, 29 Jun 2020 08:44:03 +0000 (10:44 +0200)
files/repos-el7/puppet.repo
files/repos-oel7/ol7_addons.repo
kickstart/template-oel7.ks
snippets/tpl.170.repos_el7.sh [new file with mode: 0644]
snippets/tpl.170.repos_oel7.sh [new file with mode: 0644]

index 0394956bdfd6a8cdaa25a602c085920ed5f59ad4..909d12143d6564c7112b634dd8b2d21995d42f50 100644 (file)
@@ -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
index 28376bc1aa94dafa6f4bf22454a99227e7120362..1328f39442e94ea0b80278bfbce52ee993a57fff 100644 (file)
@@ -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
index a8ae6431099acf736c604165de0798ce00fab094..3601c7876f01c394a35ec8b7815f8111c7a67246 100644 (file)
@@ -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 (file)
index 0000000..cb800a3
--- /dev/null
@@ -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 (file)
index 0000000..6582aff
--- /dev/null
@@ -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