Skip to content

Commit 224bb06

Browse files
committed
(PA-7586) Move puppetcore password check
If yum_source wasn't specified, such as when installing puppetcore on apt or mac, and a password wasn't specified, the error message incorrectly referenced yum: A password parameter is required to install from https://yum-puppetcore.puppet.com/public Move the password check prior to handling yum, apt, etc sources. If installing puppetcore packages and password isn't specified, we now report: A password parameter is required to install from puppetcore
1 parent 798731f commit 224bb06

File tree

1 file changed

+20
-39
lines changed

1 file changed

+20
-39
lines changed

tasks/install_shell.sh

Lines changed: 20 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -123,58 +123,39 @@ else
123123
collection='puppet'
124124
fi
125125

126+
if [[ "$collection" == "puppetcore"* && -z "$password" ]]; then
127+
echo "A password parameter is required to install from puppetcore"
128+
exit 1
129+
fi
130+
126131
if [ -n "$PT_yum_source" ]; then
127132
yum_source=$PT_yum_source
133+
elif [[ "$collection" == "puppetcore"* ]]; then
134+
yum_source='https://yum-puppetcore.puppet.com/public'
135+
elif [ "$nightly" = true ]; then
136+
yum_source='http://nightlies.puppet.com/yum'
128137
else
129-
if [[ "$collection" == "puppetcore"* ]]; then
130-
yum_source='https://yum-puppetcore.puppet.com/public'
131-
if [ -z "$password" ]; then
132-
echo "A password parameter is required to install from ${yum_source}"
133-
exit 1
134-
fi
135-
else
136-
if [ "$nightly" = true ]; then
137-
yum_source='http://nightlies.puppet.com/yum'
138-
else
139-
yum_source='http://yum.puppet.com'
140-
fi
141-
fi
138+
yum_source='http://yum.puppet.com'
142139
fi
143140

144141
if [ -n "$PT_apt_source" ]; then
145142
apt_source=$PT_apt_source
143+
elif [[ "$collection" == "puppetcore"* ]]; then
144+
apt_source='https://apt-puppetcore.puppet.com/public'
145+
elif [ "$nightly" = true ]; then
146+
apt_source='http://nightlies.puppet.com/apt'
146147
else
147-
if [[ "$collection" == "puppetcore"* ]]; then
148-
apt_source='https://apt-puppetcore.puppet.com/public'
149-
if [ -z "$password" ]; then
150-
echo "A password parameter is required to install from ${apt_source}"
151-
exit 1
152-
fi
153-
else
154-
if [ "$nightly" = true ]; then
155-
apt_source='http://nightlies.puppet.com/apt'
156-
else
157-
apt_source='http://apt.puppet.com'
158-
fi
159-
fi
148+
apt_source='http://apt.puppet.com'
160149
fi
161150

162151
if [ -n "$PT_mac_source" ]; then
163152
mac_source=$PT_mac_source
153+
elif [[ "$collection" == "puppetcore"* ]]; then
154+
mac_source='https://artifacts-puppetcore.puppet.com/v1/download'
155+
elif [ "$nightly" = true ]; then
156+
mac_source='http://nightlies.puppet.com/downloads'
164157
else
165-
if [[ "$collection" == "puppetcore"* ]]; then
166-
mac_source='https://artifacts-puppetcore.puppet.com/v1/download'
167-
if [ -z "$password" ]; then
168-
echo "A password parameter is required to install from ${mac_source}"
169-
exit 1
170-
fi
171-
else
172-
if [ "$nightly" = true ]; then
173-
mac_source='http://nightlies.puppet.com/downloads'
174-
else
175-
mac_source='http://downloads.puppet.com'
176-
fi
177-
fi
158+
mac_source='http://downloads.puppet.com'
178159
fi
179160

180161
if [ -n "$PT_retry" ]; then

0 commit comments

Comments
 (0)