aboutsummaryrefslogtreecommitdiff
path: root/src/terraform
diff options
context:
space:
mode:
Diffstat (limited to 'src/terraform')
-rwxr-xr-xsrc/terraform/install.sh15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/terraform/install.sh b/src/terraform/install.sh
index 3368374..358b8b2 100755
--- a/src/terraform/install.sh
+++ b/src/terraform/install.sh
@@ -122,21 +122,16 @@ find_version_from_git_tags() {
echo "${variable_name}=${!variable_name}"
}
-# Function to run apt-get if needed
-apt_get_update_if_needed()
+apt_get_update()
{
- if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then
- echo "Running apt-get update..."
- apt-get update
- else
- echo "Skipping apt-get update."
- fi
+ echo "Running apt-get update..."
+ apt-get update -y
}
# Checks if packages are installed and installs them if not
check_packages() {
if ! dpkg -s "$@" > /dev/null 2>&1; then
- apt_get_update_if_needed
+ apt_get_update
apt-get -y install --no-install-recommends "$@"
fi
}
@@ -147,7 +142,7 @@ export DEBIAN_FRONTEND=noninteractive
# Install dependencies if missing
check_packages curl ca-certificates gnupg2 dirmngr coreutils unzip
if ! type git > /dev/null 2>&1; then
- apt_get_update_if_needed
+ apt_get_update
apt-get -y install --no-install-recommends git
fi