Skip to content

Commit 6e18c8c

Browse files
committed
add windows machines to outputs
1 parent 2b07397 commit 6e18c8c

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

test_code/AZURE_MACHINES/outputs.tf

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
output "fab_hosts" {
2-
value = { for key, value in azurerm_linux_virtual_machine.linux_host_test :
2+
value = merge({
3+
for key, value in azurerm_linux_virtual_machine.linux_host_test :
34
"AZURE_${key}" => {
45
"host" = value.public_ip_address
56
"name" = value.name
@@ -10,5 +11,19 @@ output "fab_hosts" {
1011
"public_ssh_link" = "ssh -i ${var.PRIVATE_KEY_PATH} ${var.AZURE_MACHINE_CONFIGS[key].default_user}@${value.public_ip_address}"
1112
"sleep" : var.AZURE_MACHINE_CONFIGS[key].sleep
1213
}
14+
},
15+
{
16+
for key, value in azurerm_windows_virtual_machine.windows_host_test :
17+
"AZURE_${key}" => {
18+
"host" = value.public_ip_address
19+
"name" = value.name
20+
"user" = var.AZURE_WIN_MACHINE_CONFIGS[key].default_user
21+
"connect_kwargs" = {
22+
"key_filename" : var.PRIVATE_KEY_PATH
23+
}
24+
"public_ssh_link" = "ssh -i ${var.PRIVATE_KEY_PATH} ${var.AZURE_MACHINE_CONFIGS[key].default_user}@${value.public_ip_address}"
25+
"sleep" : var.AZURE_WIN_MACHINE_CONFIGS[key].sleep
26+
}
1327
}
28+
)
1429
}

test_code/AZURE_MACHINES/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ variable "AZURE_WIN_MACHINE_CONFIGS" {
9797
default = {
9898
# az vm image list --output table --all --publisher MicrosoftWindowsDesktop --sku win10-21h2-ent
9999
W10_ENT_21H2 = {
100-
recreate = "changethistorecreate1"
100+
recreate = "changethistorecreate"
101101
machine_type = "Standard_DS1_v2"
102102
description = "Windows 10 Enterprise 21H2"
103103
default_user = "test-user"
104104
default_password = "km$3MWPf&i6r4o@I"
105105
computer_name = "W10ENT21H2"
106106
wait = "120"
107-
user_data = "user_data/windows_observe.ps"
107+
user_data = "user_data/windows.ps"
108108
source_image_reference = {
109109
publisher = "MicrosoftWindowsDesktop"
110110
offer = "Windows-10"

0 commit comments

Comments
 (0)