Skip to content

Fix breaking changes in non-core repos #762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions tasks/install_shell.sh
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -602,12 +602,14 @@ install_file() {


repo="/etc/yum.repos.d/${collection/core/}-release.repo" repo="/etc/yum.repos.d/${collection/core/}-release.repo"
rpm -Uvh --oldpackage --replacepkgs "$2" rpm -Uvh --oldpackage --replacepkgs "$2"
if [[ "$collection" =~ core ]]; then
if [[ -n $username ]]; then if [[ -n $username ]]; then
sed -i "s/^#\?username=.*/username=${username}/" "${repo}" sed -i "s/^#\?username=.*/username=${username}/" "${repo}"
fi fi
if [[ -n $password ]]; then if [[ -n $password ]]; then
sed -i "s/^#\?password=.*/password=${password}/" "${repo}" sed -i "s/^#\?password=.*/password=${password}/" "${repo}"
fi fi
fi
exists dnf && PKGCMD=dnf || PKGCMD=yum exists dnf && PKGCMD=dnf || PKGCMD=yum
if test "$version" = 'latest'; then if test "$version" = 'latest'; then
run_cmd "${PKGCMD} install -y puppet-agent && ${PKGCMD} upgrade -y puppet-agent" run_cmd "${PKGCMD} install -y puppet-agent && ${PKGCMD} upgrade -y puppet-agent"
Expand All @@ -632,12 +634,14 @@ install_file() {
fi fi


run_cmd "zypper install --no-confirm '$2'" run_cmd "zypper install --no-confirm '$2'"
if [[ "$collection" =~ core ]]; then
if [[ -n $username ]]; then if [[ -n $username ]]; then
sed -i "s/^username=.*/username=${username}/" "/etc/zypp/credentials.d/PuppetcoreCreds" sed -i "s/^username=.*/username=${username}/" "/etc/zypp/credentials.d/PuppetcoreCreds"
fi fi
if [[ -n $password ]]; then if [[ -n $password ]]; then
sed -i "s/^password=.*/password=${password}/" "/etc/zypp/credentials.d/PuppetcoreCreds" sed -i "s/^password=.*/password=${password}/" "/etc/zypp/credentials.d/PuppetcoreCreds"
fi fi
fi
if test "$version" = "latest"; then if test "$version" = "latest"; then
run_cmd "zypper install --no-confirm 'puppet-agent'" run_cmd "zypper install --no-confirm 'puppet-agent'"
else else
Expand Down Expand Up @@ -700,7 +704,7 @@ case $platform in
info "SLES platform! Lets get you an RPM..." info "SLES platform! Lets get you an RPM..."


if [[ $PT__noop != true ]]; then if [[ $PT__noop != true ]]; then
if [[ "$PT_collection" =~ core ]]; then if [[ "$collection" =~ core ]]; then
for key in "puppet"; do for key in "puppet"; do
gpg_key="${tmp_dir}/RPM-GPG-KEY-${key}" gpg_key="${tmp_dir}/RPM-GPG-KEY-${key}"
do_download "https://yum-puppetcore.puppet.com/public/RPM-GPG-KEY-${key}" "$gpg_key" do_download "https://yum-puppetcore.puppet.com/public/RPM-GPG-KEY-${key}" "$gpg_key"
Expand All @@ -710,7 +714,7 @@ case $platform in
else else
for key in "puppet" "puppet-20250406"; do for key in "puppet" "puppet-20250406"; do
gpg_key="${tmp_dir}/RPM-GPG-KEY-${key}" gpg_key="${tmp_dir}/RPM-GPG-KEY-${key}"
do_download "https://yum.puppet.com/public/RPM-GPG-KEY-${key}" "$gpg_key" do_download "https://yum.puppet.com/RPM-GPG-KEY-${key}" "$gpg_key"
rpm --import "$gpg_key" rpm --import "$gpg_key"
rm -f "$gpg_key" rm -f "$gpg_key"
done done
Expand Down
Loading