Skip to content

Commit

Permalink
update installation directory for the providers
Browse files Browse the repository at this point in the history
  • Loading branch information
ADobrodey committed Dec 28, 2023
1 parent 8188dae commit c44d872
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion atlantis/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ RUN \
cp -R /root/.terraform.d /home/atlantis/ && \
cp /root/.terraformrc /home/atlantis/

ENV TF_PLUGIN_CACHE_DIR="/home/atlantis/.terraform.d/plugins"
ENV TF_PLUGIN_CACHE_DIR="/usr/share/terraform/providers"
ENV ATLANTIS_TERRAFORM_VERSION=${TERRAFORM_VERSION}
ENV DEFAULT_TERRAFORM_VERSION=$TERRAFORM_VERSION
ENV TERRAGRUNT_TFPATH="terraform${TERRAFORM_VERSION}"
Expand Down
4 changes: 2 additions & 2 deletions terraform/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ RUN wget --quiet -O /tmp/terragrunt \
#=======================================
# Terraform providers cache
#=======================================
ENV TF_PLUGIN_CACHE_DIR="/root/.terraform.d/plugins"
ENV TF_PLUGIN_CACHE_DIR="/usr/share/terraform/providers"
COPY install-providers.sh /tmp/install-providers.sh
COPY providers.txt ${TF_PLUGIN_CACHE_DIR}/../
COPY terraform.rc /root/.terraformrc
COPY terraform.rc "${HOME}/.terraformrc"
RUN /tmp/install-providers.sh \
"${TF_PLUGIN_CACHE_DIR}/../providers.txt"
COPY terragrunt-core.hcl ${TF_PLUGIN_CACHE_DIR}/../
Expand Down
1 change: 1 addition & 0 deletions terraform/install-providers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ warning() {
echo -e "${YELLOW}WARNING: ${1}${NC}"
}

TF_PLUGIN_CACHE_DIR="/usr/share/terraform/providers"
PROVIDERS_URL='https://releases.hashicorp.com'
if [[ "$(uname -p)" == "arm" ]]; then
PLATFORM="darwin_arm64"
Expand Down
3 changes: 2 additions & 1 deletion terraform/terraform.rc
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
plugin_cache_dir = "$HOME/.terraform.d/plugin-cache"
disable_checkpoint = true

provider_installation {
filesystem_mirror {
path = "$HOME/.terraform.d/plugins"
path = "/usr/share/terraform/providers"
include = [
"*/*",
"*/*/*"
Expand Down

0 comments on commit c44d872

Please sign in to comment.