From 64f75b96faedf5f3d54e1f982727c3b16a04bf41 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Wed, 24 Jan 2024 03:56:10 +0300 Subject: [PATCH 1/4] docs: use coder modules in offline deployments --- docs/install/offline.md | 43 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/docs/install/offline.md b/docs/install/offline.md index 4b168f2cd7cd0..9048a55814724 100644 --- a/docs/install/offline.md +++ b/docs/install/offline.md @@ -230,6 +230,49 @@ server, as demonstrated in the example below: With these steps, you'll have the Coder documentation hosted on your server and accessible for your team to use. +## Coder Modules + +## Air-gapped Users + +Air gapped users can clone the [coder/modules](htpps://github.com/coder/modules) repo and publish a [local terraform module repository](https://jfrog.com/help/r/jfrog-artifactory-documentation/set-up-a-terraform-module/provider-registry) to resolve modules via [Artifactory](https://jfrog.com/artifactory/). + +1. Create a local-terraform-repository with name `coder-modules-local` +2. Create a virtual repositoty with name `tf` +3. Follow the below instructions to publsh coder modules to Artifactory + + ```shell + git clone https://github.com/coder/modules + cd modules + jf tfc + jf tf p --namespace="coder" --provider="coder" --tag="1.0.0" + ``` + +4. Generate a token with accesss to the `tf` repo and set an `ENV` variable `TF_TOKEN_example.jfrog.io="XXXXXXXXXXXXXXX"` on the Coder provisioner. +5. Create a file `.terraformrc` with follwing content and mount at `/home/coder/.terraformrc` within the Coder provisioner. + + ```hcl + provider_installation { + direct { + exclude = ["registry.terraform.io/*/*"] + } + network_mirror { + url = "https://jfrt.cdr.dev/artifactory/api/terraform/tf/providers/" + } + } + ``` +7. Update module source as, + + ```hcl + module "module-name" { + source = "https://jfrog.example.com/tf__coder/module-name/coder" + version = "1.0.0" + agent_id = coder_agent.example.id + ... + } + ``` + +Based on the instructions [here](https://jfrog.com/blog/tour-terraform-registries-in-artifactory/). + ## Firewall exceptions In restricted internet networks, Coder may require connection to internet. From 9de558a69afb72fc599f627a53c3831905f3e6d7 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Wed, 24 Jan 2024 01:01:48 +0000 Subject: [PATCH 2/4] fix typos --- docs/install/offline.md | 79 ++++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 36 deletions(-) diff --git a/docs/install/offline.md b/docs/install/offline.md index 9048a55814724..3120bd528ffd8 100644 --- a/docs/install/offline.md +++ b/docs/install/offline.md @@ -234,44 +234,51 @@ accessible for your team to use. ## Air-gapped Users -Air gapped users can clone the [coder/modules](htpps://github.com/coder/modules) repo and publish a [local terraform module repository](https://jfrog.com/help/r/jfrog-artifactory-documentation/set-up-a-terraform-module/provider-registry) to resolve modules via [Artifactory](https://jfrog.com/artifactory/). +Air gapped users can clone the [coder/modules](htpps://github.com/coder/modules) +repo and publish a +[local terraform module repository](https://jfrog.com/help/r/jfrog-artifactory-documentation/set-up-a-terraform-module/provider-registry) +to resolve modules via [Artifactory](https://jfrog.com/artifactory/). 1. Create a local-terraform-repository with name `coder-modules-local` -2. Create a virtual repositoty with name `tf` -3. Follow the below instructions to publsh coder modules to Artifactory - - ```shell - git clone https://github.com/coder/modules - cd modules - jf tfc - jf tf p --namespace="coder" --provider="coder" --tag="1.0.0" - ``` - -4. Generate a token with accesss to the `tf` repo and set an `ENV` variable `TF_TOKEN_example.jfrog.io="XXXXXXXXXXXXXXX"` on the Coder provisioner. -5. Create a file `.terraformrc` with follwing content and mount at `/home/coder/.terraformrc` within the Coder provisioner. - - ```hcl - provider_installation { - direct { - exclude = ["registry.terraform.io/*/*"] - } - network_mirror { - url = "https://jfrt.cdr.dev/artifactory/api/terraform/tf/providers/" - } - } - ``` -7. Update module source as, - - ```hcl - module "module-name" { - source = "https://jfrog.example.com/tf__coder/module-name/coder" - version = "1.0.0" - agent_id = coder_agent.example.id - ... - } - ``` - -Based on the instructions [here](https://jfrog.com/blog/tour-terraform-registries-in-artifactory/). +2. Create a virtual repository with name `tf` +3. Follow the below instructions to publish coder modules to Artifactory + + ```shell + git clone https://github.com/coder/modules + cd modules + jf tfc + jf tf p --namespace="coder" --provider="coder" --tag="1.0.0" + ``` + +4. Generate a token with access to the `tf` repo and set an `ENV` variable + `TF_TOKEN_example.jfrog.io="XXXXXXXXXXXXXXX"` on the Coder provisioner. +5. Create a file `.terraformrc` with following content and mount at + `/home/coder/.terraformrc` within the Coder provisioner. + + ```hcl + provider_installation { + direct { + exclude = ["registry.terraform.io/*/*"] + } + network_mirror { + url = "https://jfrt.cdr.dev/artifactory/api/terraform/tf/providers/" + } + } + ``` + +6. Update module source as, + + ```hcl + module "module-name" { + source = "https://jfrog.example.com/tf__coder/module-name/coder" + version = "1.0.0" + agent_id = coder_agent.example.id + ... + } + ``` + +Based on the instructions +[here](https://jfrog.com/blog/tour-terraform-registries-in-artifactory/). ## Firewall exceptions From 5bdcf97fc9bd3fd0981856fbe3662327875a63bc Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Wed, 24 Jan 2024 01:03:15 +0000 Subject: [PATCH 3/4] Update offline installation instructions with Artifactory support for Coder modules --- docs/install/offline.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install/offline.md b/docs/install/offline.md index 3120bd528ffd8..0d60d52f7580d 100644 --- a/docs/install/offline.md +++ b/docs/install/offline.md @@ -232,7 +232,7 @@ accessible for your team to use. ## Coder Modules -## Air-gapped Users +### Artifactory Air gapped users can clone the [coder/modules](htpps://github.com/coder/modules) repo and publish a From d6d4980956be7e5cddf06dcb9506c78ad501cf2d Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Wed, 24 Jan 2024 22:53:32 +0300 Subject: [PATCH 4/4] Review suggestions --- docs/install/offline.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/install/offline.md b/docs/install/offline.md index 0d60d52f7580d..05cc4281a41c0 100644 --- a/docs/install/offline.md +++ b/docs/install/offline.md @@ -261,7 +261,7 @@ to resolve modules via [Artifactory](https://jfrog.com/artifactory/). exclude = ["registry.terraform.io/*/*"] } network_mirror { - url = "https://jfrt.cdr.dev/artifactory/api/terraform/tf/providers/" + url = "https://example.jfrog.io/artifactory/api/terraform/tf/providers/" } } ``` @@ -270,13 +270,15 @@ to resolve modules via [Artifactory](https://jfrog.com/artifactory/). ```hcl module "module-name" { - source = "https://jfrog.example.com/tf__coder/module-name/coder" + source = "https://example.jfrog.io/tf__coder/module-name/coder" version = "1.0.0" agent_id = coder_agent.example.id ... } ``` +> Do not forget to replace example.jgrog.io with uour Artifactory URL + Based on the instructions [here](https://jfrog.com/blog/tour-terraform-registries-in-artifactory/).