- Notifications
You must be signed in to change notification settings - Fork925
docs: update modules docs#11911
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
6 commits Select commitHold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
2 changes: 1 addition & 1 deletiondocs/changelogs/v2.1.0.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
51 changes: 2 additions & 49 deletionsdocs/install/offline.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
127 changes: 83 additions & 44 deletionsdocs/templates/modules.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -35,7 +35,87 @@ and | ||
[module sources](https://developer.hashicorp.com/terraform/language/modules/sources) | ||
in the Terraform documentation. | ||
## Coder modules | ||
Coder publishes plenty of modules that can be used to simplify some common tasks | ||
across templates. Some of the modules we publish are, | ||
1. [`code-server`](https://registry.coder.com/modules/code-server) and | ||
[`vscode-web`](https://registry.coder.com/modules/vscode-web) | ||
2. [`git-clone`](https://registry.coder.com/modules/git-clone) | ||
3. [`dotfiles`](https://registry.coder.com/modules/dotfiles) | ||
4. [`jetbrains-gateway`](https://registry.coder.com/modules/jetbrains-gateway) | ||
5. [`jfrog-oauth`](https://registry.coder.com/modules/jfrog-oauth) and | ||
[`jfrog-token`](https://registry.coder.com/modules/jfrog-token) | ||
6. [`vault-github`](https://registry.coder.com/modules/vault-github) | ||
For a full list of available modules please check | ||
[Coder module registry](https://registry.coder.com/modules). | ||
## Offline installations | ||
In offline and restricted deploymnets, there are 2 ways to fetch modules. | ||
1. Artifactory | ||
2. Private git repository | ||
### 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 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://example.jfrog.io/artifactory/api/terraform/tf/providers/" | ||
} | ||
} | ||
``` | ||
6. Update module source as, | ||
```hcl | ||
module "module-name" { | ||
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.jfrog.io with your Artifactory URL | ||
Based on the instructions | ||
[here](https://jfrog.com/blog/tour-terraform-registries-in-artifactory/). | ||
#### Example template | ||
We have an example template [here](../../examples/jfrog/remote/main.tf) that | ||
uses our [JFrog Docker](../../examples/jfrog/docker/main.tf) template as the | ||
underlying module. | ||
### Private git repository | ||
If you are importing a module from a private git repository, the Coder server or | ||
[provisioner](../admin/provisioners.md) needs git credentials. Since this token | ||
@@ -65,7 +145,7 @@ If you are running Coder on Docker or Kubernetes, `git` is pre-installed in the | ||
Coder image. However, you still need to mount credentials. This can be done via | ||
a Docker volume mount or Kubernetes secrets. | ||
#### Passing git credentials in Kubernetes | ||
matifali marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
First, create a `.gitconfig` and `.git-credentials` file on your local machine. | ||
You might want to do this in a temporary directory to avoid conflicting with | ||
@@ -108,53 +188,12 @@ coder: | ||
readOnly: true | ||
``` | ||
### Next up | ||
Learn more about | ||
- JFrog's Terraform Registry support | ||
[here](https://jfrog.com/help/r/jfrog-artifactory-documentation/terraform-registry). | ||
- Configuring the JFrog toolchain inside a workspace | ||
[here](../guides/artifactory-integration.md). | ||
- Coder Module Registry [here](https://registry.coder.com/modules) |
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.