Skip to content

Instantly share code, notes, and snippets.

@PixelRobots
Created March 4, 2019 14:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save PixelRobots/0061f0cc90bb1bb75e4bbfddfeefa343 to your computer and use it in GitHub Desktop.
Save PixelRobots/0061f0cc90bb1bb75e4bbfddfeefa343 to your computer and use it in GitHub Desktop.
resource "azurerm_virtual_machine_extension" "domjoin" {
name = "domjoin"
location = "${var.location}"
resource_group_name = "${var.image_resource_group}"
virtual_machine_name = "${var.prefix}"
publisher = "Microsoft.Compute"
type = "JsonADDomainExtension"
type_handler_version = "1.3"
# What the settings mean: https://docs.microsoft.com/en-us/windows/desktop/api/lmjoin/nf-lmjoin-netjoindomain
settings = <<SETTINGS
{
"Name": "pixelrobots.co.uk",
"OUPath": "OU=Servers,DC=pixelrobots,DC=co,DC=uk",
"User": "pixelrobots.co.uk\\pr_admin",
"Restart": "true",
"Options": "3"
}
SETTINGS
protected_settings = <<PROTECTED_SETTINGS
{
"Password": "${var.admin_password}"
}
PROTECTED_SETTINGS
depends_on = ["azurerm_virtual_machine.vm"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment