Skip to content

Commit 84dc829

Browse files
committed
wip fix command exec and repo defaults
1 parent 0e5ea55 commit 84dc829

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.modules
22
.plan_cache.json
3+
.rerun.json
4+
.resource_types
35
.task_cache.json
46
Puppetfile

tasks/install.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
"apt_source": {
1414
"description": "The apt source repository to retrieve deb packages from.",
1515
"type": "Optional[String]",
16-
"default": "http://apt.overlookinfratech.com"
16+
"default": "https://apt.overlookinfratech.com"
1717
},
1818
"yum_source": {
1919
"description": "The yum source repository to retrieve rpm packages from.",
2020
"type": "Optional[String]",
21-
"default": "http://yum.overlookinfratech.com"
21+
"default": "https://yum.overlookinfratech.com"
2222
}
2323
},
2424
"implementations": [

tasks/install_linux.sh

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ set_collection_url() {
140140
else
141141
package_name="${collection}-release-${family}${full_version}.${package_file_suffix}"
142142
fi
143-
package_url="https://${repository}/${package_name}"
143+
package_url="${repository}/${package_name}"
144144

145145
assigned 'package_name'
146146
assigned 'package_url'
@@ -151,9 +151,14 @@ exec_and_capture() {
151151

152152
info "Executing: ${_cmd}"
153153
local _result
154+
155+
set +e
154156
result=$(${_cmd} 2>&1)
155157
local _status=$?
158+
set -e
159+
156160
echo "${result}"
161+
info "Status: ${_status}"
157162
return $_status
158163
}
159164

@@ -191,13 +196,14 @@ install_release_package() {
191196
local _package_type="$1"
192197
local _package_file="$2"
193198

199+
info "Installing release package: ${_package_file}"
194200
case $_package_type in
195201
rpm)
196-
rpm -Uvh "$_package_file"
202+
exec_and_capture rpm -Uvh "$_package_file"
197203
;;
198204
deb)
199-
dpkg -i "$_package_file"
200-
apt update
205+
exec_and_capture dpkg -i "$_package_file"
206+
exec_and_capture apt update
201207
;;
202208
*)
203209
fail "Unhandled package type: '${package_type}'"
@@ -208,14 +214,15 @@ install_release_package() {
208214
install_package() {
209215
local _package="$1"
210216

217+
info "Installing ${_package}"
211218
if exists 'dnf'; then
212-
dnf install -y "$_package"
219+
exec_and_capture dnf install -y "$_package"
213220
elif exists 'yum'; then
214-
yum install -y "$_package"
221+
exec_and_capture yum install -y "$_package"
215222
elif exists 'zypper'; then
216-
zypper install -y "$_package"
223+
exec_and_capture zypper install -y "$_package"
217224
elif exists 'apt'; then
218-
apt install -y "$_package"
225+
exec_and_capture apt install -y "$_package"
219226
else
220227
fail "Unable to install ${_package}. Neither dnf, yum, zypper, nor apt are installed."
221228
fi

0 commit comments

Comments
 (0)