Skip to content

Commit 64f75b9

Browse files
authored
docs: use coder modules in offline deployments
1 parent 31a6a5d commit 64f75b9

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

docs/install/offline.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,49 @@ server, as demonstrated in the example below:
230230
With these steps, you'll have the Coder documentation hosted on your server and
231231
accessible for your team to use.
232232

233+
## Coder Modules
234+
235+
## Air-gapped Users
236+
237+
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/).
238+
239+
1. Create a local-terraform-repository with name `coder-modules-local`
240+
2. Create a virtual repositoty with name `tf`
241+
3. Follow the below instructions to publsh coder modules to Artifactory
242+
243+
```shell
244+
git clone https://github.com/coder/modules
245+
cd modules
246+
jf tfc
247+
jf tf p --namespace="coder" --provider="coder" --tag="1.0.0"
248+
```
249+
250+
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.
251+
5. Create a file `.terraformrc` with follwing content and mount at `/home/coder/.terraformrc` within the Coder provisioner.
252+
253+
```hcl
254+
provider_installation {
255+
direct {
256+
exclude = ["registry.terraform.io/*/*"]
257+
}
258+
network_mirror {
259+
url = "https://jfrt.cdr.dev/artifactory/api/terraform/tf/providers/"
260+
}
261+
}
262+
```
263+
7. Update module source as,
264+
265+
```hcl
266+
module "module-name" {
267+
source = "https://jfrog.example.com/tf__coder/module-name/coder"
268+
version = "1.0.0"
269+
agent_id = coder_agent.example.id
270+
...
271+
}
272+
```
273+
274+
Based on the instructions [here](https://jfrog.com/blog/tour-terraform-registries-in-artifactory/).
275+
233276
## Firewall exceptions
234277

235278
In restricted internet networks, Coder may require connection to internet.

0 commit comments

Comments
 (0)