Skip to content

Commit

Permalink
adding extension scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcalalang committed Jan 18, 2024
1 parent 1ad5fec commit 5d0e8a4
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,23 @@ resource "azurerm_windows_virtual_machine" "active-directory-instance" {
}
}

# Install IIS web server to the virtual machine
resource "azurerm_virtual_machine_extension" "ad-domain-services" {
name = "ad-extension-${random_string.active-directory-random-string[0].result}"
virtual_machine_id = azurerm_windows_virtual_machine.active-directory-instance[count.index].id
publisher = "Microsoft.Compute"
type = "CustomScriptExtension"
type_handler_version = "2.0"
auto_upgrade_minor_version = true
count = sum([var.active-directory-instance-count])

settings = <<SETTINGS
{
"commandToExecute": "powershell -ExecutionPolicy Unrestricted Install-WindowsFeature -name AD-Domain-Services -IncludeManagementTools"
}
SETTINGS
}

## Availability Set
resource "azurerm_availability_set" "active-directory-instance" {
name = "a-set-${random_string.active-directory-random-string[0].result}"
Expand Down

0 comments on commit 5d0e8a4

Please sign in to comment.