From 33275d69dd3b17dfa3330311b361601febda0b46 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Fri, 25 Oct 2019 10:27:33 +0200 Subject: [PATCH] Changing Repo handling in postinst scripts --- bin/postinst | 13 +++++++++---- bin/postinst.chrony | 16 +++++++++++++--- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/bin/postinst b/bin/postinst index 8f7bf4b..7d324ce 100644 --- a/bin/postinst +++ b/bin/postinst @@ -346,12 +346,14 @@ install_epel() { if [[ ! -f "${repo_file}" ]] ; then continue fi - cp -pv "${repo_file}" /etc/yum.repos.d/.old + mv -v "${repo_file}" /etc/yum.repos.d/.old done - local repo_files="epel.repo epel-testing.repo puppet.repo rpm-repo.pixelpark.com.repo" + local repo_files="epel.repo epel-testing.repo puppet.repo pixelpark.repo" if [[ -f "/etc/oracle-release" ]] ; then - repo_files="public-yum-ol7.repo ${repo_files}" + repo_files="ol7_addons.repo ol7_latest.repo ol7_optional_latest.repo ${repo_files}" + elif [[ -f /etc/centos-release ]] ; then + repo_files="centos-base.repo ${repo_files}" fi for bname in ${repo_files} ; do @@ -371,7 +373,10 @@ install_epel() { chmod -v 0755 "/etc/pki" chmod -v 0755 "/etc/pki/rpm-gpg" - for bname in RPM-GPG-KEY-EPEL-7 RPM-GPG-KEY-pixelpark RPM-GPG-KEY-puppet-release ; do + local key_files="RPM-GPG-KEY-CentOS-SIG-Storage RPM-GPG-KEY-EPEL-7 RPM-GPG-KEY-oracle" + key_files+=" RPM-GPG-KEY-pixelpark RPM-GPG-KEY-puppet-release" + + for bname in ${key_files} ; do url="${COBBLER_URL}/custom/create-vmware-tpl/yum.repos/${bname}" tgt="/etc/pki/rpm-gpg/${bname}" echo diff --git a/bin/postinst.chrony b/bin/postinst.chrony index 6b9d606..9ed49f4 100644 --- a/bin/postinst.chrony +++ b/bin/postinst.chrony @@ -332,10 +332,17 @@ install_epel() { if [[ ! -f "${repo_file}" ]] ; then continue fi - cp -pv "${repo_file}" /etc/yum.repos.d/.old + mv -v "${repo_file}" /etc/yum.repos.d/.old done - for bname in public-yum-ol7.repo epel.repo epel-testing.repo puppet.repo rpm-repo.pixelpark.com.repo ; do + local repo_files="epel.repo epel-testing.repo puppet.repo pixelpark.repo" + if [[ -f "/etc/oracle-release" ]] ; then + repo_files="ol7_addons.repo ol7_latest.repo ol7_optional_latest.repo ${repo_files}" + elif [[ -f /etc/centos-release ]] ; then + repo_files="centos-base.repo ${repo_files}" + fi + + for bname in ${repo_files} ; do url="${COBBLER_URL}/custom/create-vmware-tpl/yum.repos/${bname}" tgt="/etc/yum.repos.d/${bname}" echo @@ -352,7 +359,10 @@ install_epel() { chmod -v 0755 "/etc/pki" chmod -v 0755 "/etc/pki/rpm-gpg" - for bname in RPM-GPG-KEY-EPEL-7 RPM-GPG-KEY-pixelpark RPM-GPG-KEY-puppet-release ; do + local key_files="RPM-GPG-KEY-CentOS-SIG-Storage RPM-GPG-KEY-EPEL-7 RPM-GPG-KEY-oracle" + key_files+=" RPM-GPG-KEY-pixelpark RPM-GPG-KEY-puppet-release" + + for bname in ${key_files} ; do url="${COBBLER_URL}/custom/create-vmware-tpl/yum.repos/${bname}" tgt="/etc/pki/rpm-gpg/${bname}" echo -- 2.39.5