Skip to content

docs: use coder modules in offline deployments #11788

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix typos
  • Loading branch information
matifali committed Jan 24, 2024
commit 9de558a69afb72fc599f627a53c3831905f3e6d7
79 changes: 43 additions & 36 deletions docs/install/offline.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down