From 3c4735039317d2c22951643dba6f82ca4036e35a Mon Sep 17 00:00:00 2001 From: "blink-so[bot]" <211532188+blink-so[bot]@users.noreply.github.com> Date: Wed, 11 Jun 2025 16:49:18 +0000 Subject: [PATCH 1/3] feat: add configurable Devolutions Gateway version for windows-rdp module - Add devolutions_gateway_version variable with default to latest version (2025.2.1) - Update PowerShell script to use configurable version instead of hardcoded 2024.1.5 - Add comprehensive documentation for all variables in README - Include example usage with custom version Resolves #145 Co-authored-by: matifali <10648092+matifali@users.noreply.github.com> --- registry/coder/modules/windows-rdp/README.md | 24 +++++++++++++++++++ registry/coder/modules/windows-rdp/main.tf | 11 +++++++-- .../powershell-installation-script.tftpl | 2 +- 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/registry/coder/modules/windows-rdp/README.md b/registry/coder/modules/windows-rdp/README.md index 87bd98d72..991ccfdbe 100644 --- a/registry/coder/modules/windows-rdp/README.md +++ b/registry/coder/modules/windows-rdp/README.md @@ -26,6 +26,17 @@ module "windows_rdp" { [![Video](./video-thumbnails/video-thumbnail.png)](https://github.com/coder/modules/assets/28937484/fb5f4a55-7b69-4550-ab62-301e13a4be02) +## Variables + +| Name | Description | Type | Default | Required | +| ----------------------------- | ---------------------------------------------- | -------- | ----------------- | -------- | +| `agent_id` | The ID of a Coder agent | `string` | n/a | yes | +| `resource_id` | The ID of the primary Coder resource (e.g. VM) | `string` | n/a | yes | +| `admin_username` | Administrator username for RDP access | `string` | `"Administrator"` | no | +| `admin_password` | Administrator password for RDP access | `string` | `"coderRDP!"` | no | +| `devolutions_gateway_version` | Version of Devolutions Gateway to install | `string` | `"2025.2.1"` | no | +| `share` | Sharing level for the RDP app | `string` | `"owner"` | no | + ## Examples ### With AWS @@ -52,6 +63,19 @@ module "windows_rdp" { } ``` +### With Custom Devolutions Gateway Version + +```tf +module "windows_rdp" { + count = data.coder_workspace.me.start_count + source = "registry.coder.com/coder/windows-rdp/coder" + version = "1.0.18" + agent_id = resource.coder_agent.main.id + resource_id = resource.aws_instance.dev.id + devolutions_gateway_version = "2025.1.6" # Specify a specific version +} +``` + ## Roadmap - [ ] Test on Microsoft Azure. diff --git a/registry/coder/modules/windows-rdp/main.tf b/registry/coder/modules/windows-rdp/main.tf index 10ece09c4..40c29c4e8 100644 --- a/registry/coder/modules/windows-rdp/main.tf +++ b/registry/coder/modules/windows-rdp/main.tf @@ -39,14 +39,21 @@ variable "admin_password" { sensitive = true } +variable "devolutions_gateway_version" { + type = string + default = "2025.2.1" + description = "Version of Devolutions Gateway to install. Defaults to the latest available version." +} + resource "coder_script" "windows-rdp" { agent_id = var.agent_id display_name = "windows-rdp" icon = "/icon/desktop.svg" script = templatefile("${path.module}/powershell-installation-script.tftpl", { - admin_username = var.admin_username - admin_password = var.admin_password + admin_username = var.admin_username + admin_password = var.admin_password + devolutions_gateway_version = var.devolutions_gateway_version # Wanted to have this be in the powershell template file, but Terraform # doesn't allow recursive calls to the templatefile function. Have to feed diff --git a/registry/coder/modules/windows-rdp/powershell-installation-script.tftpl b/registry/coder/modules/windows-rdp/powershell-installation-script.tftpl index 1b7ab487b..c30535842 100644 --- a/registry/coder/modules/windows-rdp/powershell-installation-script.tftpl +++ b/registry/coder/modules/windows-rdp/powershell-installation-script.tftpl @@ -21,7 +21,7 @@ function Configure-RDP { function Install-DevolutionsGateway { # Define the module name and version $moduleName = "DevolutionsGateway" -$moduleVersion = "2024.1.5" +$moduleVersion = "${devolutions_gateway_version}" # Install the module with the specified version for all users # This requires administrator privileges From 6241a9ea9a6c5d9d93a4010c511bf0b88135620a Mon Sep 17 00:00:00 2001 From: "blink-so[bot]" <211532188+blink-so[bot]@users.noreply.github.com> Date: Wed, 11 Jun 2025 17:02:21 +0000 Subject: [PATCH 2/3] docs: remove variables section from README per review feedback The registry frontend automatically parses variables, so manual documentation is not needed. Co-authored-by: matifali <10648092+matifali@users.noreply.github.com> --- registry/coder/modules/windows-rdp/README.md | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/registry/coder/modules/windows-rdp/README.md b/registry/coder/modules/windows-rdp/README.md index 991ccfdbe..222980f40 100644 --- a/registry/coder/modules/windows-rdp/README.md +++ b/registry/coder/modules/windows-rdp/README.md @@ -26,17 +26,6 @@ module "windows_rdp" { [![Video](./video-thumbnails/video-thumbnail.png)](https://github.com/coder/modules/assets/28937484/fb5f4a55-7b69-4550-ab62-301e13a4be02) -## Variables - -| Name | Description | Type | Default | Required | -| ----------------------------- | ---------------------------------------------- | -------- | ----------------- | -------- | -| `agent_id` | The ID of a Coder agent | `string` | n/a | yes | -| `resource_id` | The ID of the primary Coder resource (e.g. VM) | `string` | n/a | yes | -| `admin_username` | Administrator username for RDP access | `string` | `"Administrator"` | no | -| `admin_password` | Administrator password for RDP access | `string` | `"coderRDP!"` | no | -| `devolutions_gateway_version` | Version of Devolutions Gateway to install | `string` | `"2025.2.1"` | no | -| `share` | Sharing level for the RDP app | `string` | `"owner"` | no | - ## Examples ### With AWS From 9115df14f89fa23c84ac2a1b02fa013447bbd2ba Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Wed, 11 Jun 2025 23:11:17 +0500 Subject: [PATCH 3/3] Bump windows-rdp version in README to 1.2.0 --- registry/coder/modules/windows-rdp/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/registry/coder/modules/windows-rdp/README.md b/registry/coder/modules/windows-rdp/README.md index d93fe8ae8..cad96407b 100644 --- a/registry/coder/modules/windows-rdp/README.md +++ b/registry/coder/modules/windows-rdp/README.md @@ -16,7 +16,7 @@ Enable Remote Desktop + a web based client on Windows workspaces, powered by [de module "windows_rdp" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/windows-rdp/coder" - version = "1.1.0" + version = "1.2.0" agent_id = resource.coder_agent.main.id resource_id = resource.aws_instance.dev.id } @@ -34,7 +34,7 @@ module "windows_rdp" { module "windows_rdp" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/windows-rdp/coder" - version = "1.1.0" + version = "1.2.0" agent_id = resource.coder_agent.main.id resource_id = resource.aws_instance.dev.id } @@ -46,7 +46,7 @@ module "windows_rdp" { module "windows_rdp" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/windows-rdp/coder" - version = "1.1.0" + version = "1.2.0" agent_id = resource.coder_agent.main.id resource_id = resource.google_compute_instance.dev[0].id } @@ -58,7 +58,7 @@ module "windows_rdp" { module "windows_rdp" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/windows-rdp/coder" - version = "1.0.18" + version = "1.2.0" agent_id = resource.coder_agent.main.id resource_id = resource.aws_instance.dev.id devolutions_gateway_version = "2025.1.6" # Specify a specific version