⇒ cat 5.join-domain.tf
resource "azurerm_virtual_machine_extension" "join-domain" {
count = "${var.vmcount}"
name = "${element(azurerm_virtual_machine.windows-vm.*.name, count.index)}"
location = "${data.azurerm_resource_group.myresourcegroup.location}"
resource_group_name = "${data.azurerm_resource_group.myresourcegroup.name}"
virtual_machine_name = "${element(azurerm_virtual_machine.windows-vm.*.name, count.index)}"
publisher = "Microsoft.Compute"
type = "JsonADDomainExtension"
type_handler_version = "1.3"
# NOTE: the `OUPath` field is intentionally blank, to put it in the Computers OU
settings = <<SETTINGS
{
"Name": "${var.active_directory_domain}",
"OUPath": "",
"User": "${var.active_directory_domain}\\${data.azurerm_key_vault_secret.myWinUser.value}",
"Restart": "true",
"Options": "3"
}
SETTINGS
protected_settings = <<SETTINGS
{
"Password": "${data.azurerm_key_vault_secret.myWinPass.value}"
}
SETTINGS
}
manjeet@Manjeets-MBP:~/manjeet-working/tf-demo/AzureDemo/az-dsc|
⇒ /Users/manjeet/manjeet-working/vagrant/terraform apply
data.azurerm_resource_group.myresourcegroup: Refreshing state...
azurerm_public_ip.windows-public-ip[0]: Refreshing state... [id=/subscriptions/14692f20-9428-451b-8298-102ed4e39c2a/resourceGroups/markel-project-resources/providers/Microsoft.Network/publicIPAddresses/win-vm-public-ip-0]
data.azurerm_network_security_group.nw_sg: Refreshing state...
data.azurerm_virtual_network.vnet: Refreshing state...
data.azurerm_key_vault.keyvault: Refreshing state...
data.azurerm_subnet.subnet: Refreshing state...
data.azurerm_key_vault_secret.myWinPass: Refreshing state...
data.azurerm_key_vault_secret.myWinUser: Refreshing state...
azurerm_key_vault_certificate.vm_certificate[0]: Refreshing state... [id=https://markel-project-keyvault.vault.azure.net/certificates/win-client-0-cert/9191800430f746a1871d5c2f33a124c9]
azurerm_network_interface.windows-vm-nic[0]: Refreshing state... [id=/subscriptions/14692f20-9428-451b-8298-102ed4e39c2a/resourceGroups/markel-project-resources/providers/Microsoft.Network/networkInterfaces/win-client-vm-nic-0]
azurerm_virtual_machine.windows-vm[0]: Refreshing state... [id=/subscriptions/14692f20-9428-451b-8298-102ed4e39c2a/resourceGroups/markel-project-resources/providers/Microsoft.Compute/virtualMachines/win-client-0]
azurerm_virtual_machine_extension.dsc_extension[0]: Refreshing state... [id=/subscriptions/14692f20-9428-451b-8298-102ed4e39c2a/resourceGroups/markel-project-resources/providers/Microsoft.Compute/virtualMachines/win-client-0/extensions/win-client-0-DSC]
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# azurerm_virtual_machine_extension.join-domain[0] will be created
+ resource "azurerm_virtual_machine_extension" "join-domain" {
+ id = (known after apply)
+ location = "eastus"
+ name = "win-client-0"
+ protected_settings = (sensitive value)
+ publisher = "Microsoft.Compute"
+ resource_group_name = "markel-project-resources"
+ settings = jsonencode(
{
+ Name = "hashidemos.com"
+ OUPath = ""
+ Options = "3"
+ Restart = "true"
+ User = "hashidemos.com\\testadmin"
}
)
+ tags = (known after apply)
+ type = "JsonADDomainExtension"
+ type_handler_version = "1.3"
+ virtual_machine_name = "win-client-0"
}
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
azurerm_virtual_machine_extension.join-domain[0]: Creating...
azurerm_virtual_machine_extension.join-domain[0]: Still creating... [10s elapsed]
azurerm_virtual_machine_extension.join-domain[0]: Still creating... [20s elapsed]
azurerm_virtual_machine_extension.join-domain[0]: Still creating... [30s elapsed]
azurerm_virtual_machine_extension.join-domain[0]: Still creating... [40s elapsed]
azurerm_virtual_machine_extension.join-domain[0]: Still creating... [50s elapsed]
azurerm_virtual_machine_extension.join-domain[0]: Still creating... [1m0s elapsed]
azurerm_virtual_machine_extension.join-domain[0]: Creation complete after 1m1s [id=/subscriptions/14692f20-9428-451b-8298-102ed4e39c2a/resourceGroups/markel-project-resources/providers/Microsoft.Compute/virtualMachines/win-client-0/extensions/win-client-0]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
manjeet@Manjeets-MBP:~/manjeet-working/tf-demo/AzureDemo/az-dsc|
⇒
resource "azurerm_virtual_machine_extension" "join-domain" {
count = "${var.vmcount}"
name = "${element(azurerm_virtual_machine.windows-vm.*.name, count.index)}"
location = "${data.azurerm_resource_group.myresourcegroup.location}"
resource_group_name = "${data.azurerm_resource_group.myresourcegroup.name}"
virtual_machine_name = "${element(azurerm_virtual_machine.windows-vm.*.name, count.index)}"
publisher = "Microsoft.Compute"
type = "JsonADDomainExtension"
type_handler_version = "1.3"
# NOTE: the `OUPath` field is intentionally blank, to put it in the Computers OU
settings = <<SETTINGS
{
"Name": "${var.active_directory_domain}",
"OUPath": "",
"User": "${var.active_directory_domain}\\${data.azurerm_key_vault_secret.myWinUser.value}",
"Restart": "true",
"Options": "3"
}
SETTINGS
protected_settings = <<SETTINGS
{
"Password": "${data.azurerm_key_vault_secret.myWinPass.value}"
}
SETTINGS
}
manjeet@Manjeets-MBP:~/manjeet-working/tf-demo/AzureDemo/az-dsc|
⇒ /Users/manjeet/manjeet-working/vagrant/terraform apply
data.azurerm_resource_group.myresourcegroup: Refreshing state...
azurerm_public_ip.windows-public-ip[0]: Refreshing state... [id=/subscriptions/14692f20-9428-451b-8298-102ed4e39c2a/resourceGroups/markel-project-resources/providers/Microsoft.Network/publicIPAddresses/win-vm-public-ip-0]
data.azurerm_network_security_group.nw_sg: Refreshing state...
data.azurerm_virtual_network.vnet: Refreshing state...
data.azurerm_key_vault.keyvault: Refreshing state...
data.azurerm_subnet.subnet: Refreshing state...
data.azurerm_key_vault_secret.myWinPass: Refreshing state...
data.azurerm_key_vault_secret.myWinUser: Refreshing state...
azurerm_key_vault_certificate.vm_certificate[0]: Refreshing state... [id=https://markel-project-keyvault.vault.azure.net/certificates/win-client-0-cert/9191800430f746a1871d5c2f33a124c9]
azurerm_network_interface.windows-vm-nic[0]: Refreshing state... [id=/subscriptions/14692f20-9428-451b-8298-102ed4e39c2a/resourceGroups/markel-project-resources/providers/Microsoft.Network/networkInterfaces/win-client-vm-nic-0]
azurerm_virtual_machine.windows-vm[0]: Refreshing state... [id=/subscriptions/14692f20-9428-451b-8298-102ed4e39c2a/resourceGroups/markel-project-resources/providers/Microsoft.Compute/virtualMachines/win-client-0]
azurerm_virtual_machine_extension.dsc_extension[0]: Refreshing state... [id=/subscriptions/14692f20-9428-451b-8298-102ed4e39c2a/resourceGroups/markel-project-resources/providers/Microsoft.Compute/virtualMachines/win-client-0/extensions/win-client-0-DSC]
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# azurerm_virtual_machine_extension.join-domain[0] will be created
+ resource "azurerm_virtual_machine_extension" "join-domain" {
+ id = (known after apply)
+ location = "eastus"
+ name = "win-client-0"
+ protected_settings = (sensitive value)
+ publisher = "Microsoft.Compute"
+ resource_group_name = "markel-project-resources"
+ settings = jsonencode(
{
+ Name = "hashidemos.com"
+ OUPath = ""
+ Options = "3"
+ Restart = "true"
+ User = "hashidemos.com\\testadmin"
}
)
+ tags = (known after apply)
+ type = "JsonADDomainExtension"
+ type_handler_version = "1.3"
+ virtual_machine_name = "win-client-0"
}
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
azurerm_virtual_machine_extension.join-domain[0]: Creating...
azurerm_virtual_machine_extension.join-domain[0]: Still creating... [10s elapsed]
azurerm_virtual_machine_extension.join-domain[0]: Still creating... [20s elapsed]
azurerm_virtual_machine_extension.join-domain[0]: Still creating... [30s elapsed]
azurerm_virtual_machine_extension.join-domain[0]: Still creating... [40s elapsed]
azurerm_virtual_machine_extension.join-domain[0]: Still creating... [50s elapsed]
azurerm_virtual_machine_extension.join-domain[0]: Still creating... [1m0s elapsed]
azurerm_virtual_machine_extension.join-domain[0]: Creation complete after 1m1s [id=/subscriptions/14692f20-9428-451b-8298-102ed4e39c2a/resourceGroups/markel-project-resources/providers/Microsoft.Compute/virtualMachines/win-client-0/extensions/win-client-0]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
manjeet@Manjeets-MBP:~/manjeet-working/tf-demo/AzureDemo/az-dsc|
⇒
No comments:
Post a Comment