This repository was archived by the owner on May 15, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -34,9 +34,14 @@ resource "coder_script" "windows-rdp" {
34
34
agent_id = var. agent_id
35
35
display_name = " windows-rdp"
36
36
icon = " https://svgur.com/i/158F.svg" # TODO: add to Coder icons
37
+
37
38
script = templatefile (" ${ path . module } /windows-installation.tftpl" , {
38
- CODER_USERNAME = var.admin_username,
39
- CODER_PASSWORD = var.admin_password,
39
+ admin_username = var.admin_username
40
+ admin_password = var.admin_password
41
+ patch_file_contents = templatefile (" ${ path . module } /devolutions-patch.js" , {
42
+ CODER_USERNAME = var.admin_username
43
+ CODER_PASSWORD = var.admin_password
44
+ })
40
45
})
41
46
42
47
run_on_start = true
Original file line number Diff line number Diff line change @@ -3,9 +3,9 @@ function Set-AdminPassword {
3
3
[string ]$adminPassword
4
4
)
5
5
# Set admin password
6
- Get- LocalUser - Name " ${ var . admin_username } " | Set- LocalUser - Password (ConvertTo- SecureString - AsPlainText $adminPassword - Force)
6
+ Get- LocalUser - Name " ${ admin_username } " | Set- LocalUser - Password (ConvertTo- SecureString - AsPlainText $adminPassword - Force)
7
7
# Enable admin user
8
- Get- LocalUser - Name " ${ var . admin_username } " | Enable- LocalUser
8
+ Get- LocalUser - Name " ${ admin_username } " | Enable- LocalUser
9
9
}
10
10
11
11
function Configure-RDP {
@@ -69,10 +69,7 @@ $patch = '<script defer id="coder-patch" src="coder.js"></script>'
69
69
70
70
# Always copy the file in case we change it.
71
71
@'
72
- ${templatefile (" ${ path . module } /devolutions-patch.js" , {
73
- CODER_USERNAME : var .admin_username,
74
- CODER_PASSWORD : var .admin_password,
75
- })}
72
+ ${patch_file_contents}
76
73
'@ | Set- Content " $root\coder.js"
77
74
78
75
# Only inject the src if we have not before.
@@ -82,7 +79,7 @@ if ($isPatched -eq $null) {
82
79
}
83
80
}
84
81
85
- Set-AdminPassword -adminPassword "${var . admin_password }"
82
+ Set-AdminPassword -adminPassword "${admin_password}"
86
83
Configure-RDP
87
84
Install-DevolutionsGateway
88
85
Patch-Devolutions-HTML
You can’t perform that action at this time.
0 commit comments