Skip to content

Commit 6f5fbc7

Browse files
committed
adding winRM and additional_unattend_content blocks to windows scale set
1 parent 2a9992a commit 6f5fbc7

File tree

2 files changed

+36
-20
lines changed

2 files changed

+36
-20
lines changed

main.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,22 @@ resource "azurerm_windows_virtual_machine_scale_set" "winsrv_vmss" {
492492
}
493493
}
494494

495+
dynamic "winrm_listener" {
496+
for_each = var.winrm_protocol != null ? [1] : []
497+
content {
498+
protocol = var.winrm_protocol
499+
certificate_url = var.winrm_protocol == "Https" ? var.key_vault_certificate_secret_url : null
500+
}
501+
}
502+
503+
dynamic "additional_unattend_content" {
504+
for_each = var.additional_unattend_content != null ? [1] : []
505+
content {
506+
content = var.additional_unattend_content
507+
setting = var.additional_unattend_content_setting
508+
}
509+
}
510+
495511
dynamic "boot_diagnostics" {
496512
for_each = var.enable_boot_diagnostics ? [1] : []
497513
content {

variables.tf

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,26 @@ variable "managed_identity_ids" {
453453
default = null
454454
}
455455

456+
variable "winrm_protocol" {
457+
description = "Specifies the protocol of winrm listener. Possible values are `Http` or `Https`"
458+
default = null
459+
}
460+
461+
variable "key_vault_certificate_secret_url" {
462+
description = "The Secret URL of a Key Vault Certificate, which must be specified when `protocol` is set to `Https`"
463+
default = null
464+
}
465+
466+
variable "additional_unattend_content" {
467+
description = "The XML formatted content that is added to the unattend.xml file for the specified path and component."
468+
default = null
469+
}
470+
471+
variable "additional_unattend_content_setting" {
472+
description = "The name of the setting to which the content applies. Possible values are `AutoLogon` and `FirstLogonCommands`"
473+
default = null
474+
}
475+
456476
variable "enable_boot_diagnostics" {
457477
description = "Should the boot diagnostics enabled?"
458478
default = false
@@ -467,31 +487,11 @@ variable "storage_account_uri" {
467487

468488

469489

470-
471-
472-
473490
variable "grace_period" {
474491
description = "Amount of time (in minutes, between 30 and 90, defaults to 30 minutes) for which automatic repairs will be delayed."
475492
default = "PT30M"
476493
}
477494

478-
479-
480-
481-
482-
483-
484-
485-
486-
487-
488-
489-
490-
491-
492-
493-
494-
495495
variable "enable_autoscale_for_vmss" {
496496
description = "Manages a AutoScale Setting which can be applied to Virtual Machine Scale Sets"
497497
default = false

0 commit comments

Comments
 (0)