Skip to content

Commit 0f71bcf

Browse files
authored
Merge pull request #762 from joshcooper/gpg_sles
Fix breaking changes in non-core repos
2 parents acf0ad9 + 1022508 commit 0f71bcf

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

tasks/install_shell.sh

+12-8
Original file line numberDiff line numberDiff line change
@@ -602,11 +602,13 @@ install_file() {
602602

603603
repo="/etc/yum.repos.d/${collection/core/}-release.repo"
604604
rpm -Uvh --oldpackage --replacepkgs "$2"
605-
if [[ -n $username ]]; then
605+
if [[ "$collection" =~ core ]]; then
606+
if [[ -n $username ]]; then
606607
sed -i "s/^#\?username=.*/username=${username}/" "${repo}"
607-
fi
608-
if [[ -n $password ]]; then
608+
fi
609+
if [[ -n $password ]]; then
609610
sed -i "s/^#\?password=.*/password=${password}/" "${repo}"
611+
fi
610612
fi
611613
exists dnf && PKGCMD=dnf || PKGCMD=yum
612614
if test "$version" = 'latest'; then
@@ -632,11 +634,13 @@ install_file() {
632634
fi
633635

634636
run_cmd "zypper install --no-confirm '$2'"
635-
if [[ -n $username ]]; then
637+
if [[ "$collection" =~ core ]]; then
638+
if [[ -n $username ]]; then
636639
sed -i "s/^username=.*/username=${username}/" "/etc/zypp/credentials.d/PuppetcoreCreds"
637-
fi
638-
if [[ -n $password ]]; then
640+
fi
641+
if [[ -n $password ]]; then
639642
sed -i "s/^password=.*/password=${password}/" "/etc/zypp/credentials.d/PuppetcoreCreds"
643+
fi
640644
fi
641645
if test "$version" = "latest"; then
642646
run_cmd "zypper install --no-confirm 'puppet-agent'"
@@ -700,7 +704,7 @@ case $platform in
700704
info "SLES platform! Lets get you an RPM..."
701705

702706
if [[ $PT__noop != true ]]; then
703-
if [[ "$PT_collection" =~ core ]]; then
707+
if [[ "$collection" =~ core ]]; then
704708
for key in "puppet"; do
705709
gpg_key="${tmp_dir}/RPM-GPG-KEY-${key}"
706710
do_download "https://yum-puppetcore.puppet.com/public/RPM-GPG-KEY-${key}" "$gpg_key"
@@ -710,7 +714,7 @@ case $platform in
710714
else
711715
for key in "puppet" "puppet-20250406"; do
712716
gpg_key="${tmp_dir}/RPM-GPG-KEY-${key}"
713-
do_download "https://yum.puppet.com/public/RPM-GPG-KEY-${key}" "$gpg_key"
717+
do_download "https://yum.puppet.com/RPM-GPG-KEY-${key}" "$gpg_key"
714718
rpm --import "$gpg_key"
715719
rm -f "$gpg_key"
716720
done

0 commit comments

Comments
 (0)