fix 301-hub-spoke
This commit is contained in:
parent
376f0a3732
commit
96cd33dea4
@ -55,7 +55,7 @@ resource "azurerm_virtual_machine" "hub-nva-vm" {
|
|||||||
os_profile {
|
os_profile {
|
||||||
computer_name = "${local.prefix-hub-nva}-vm"
|
computer_name = "${local.prefix-hub-nva}-vm"
|
||||||
admin_username = var.username
|
admin_username = var.username
|
||||||
admin_password = var.password
|
admin_password = local.password
|
||||||
}
|
}
|
||||||
|
|
||||||
os_profile_linux_config {
|
os_profile_linux_config {
|
||||||
|
@ -84,7 +84,7 @@ resource "azurerm_virtual_machine" "hub-vm" {
|
|||||||
os_profile {
|
os_profile {
|
||||||
computer_name = "${local.prefix-hub}-vm"
|
computer_name = "${local.prefix-hub}-vm"
|
||||||
admin_username = var.username
|
admin_username = var.username
|
||||||
admin_password = var.password
|
admin_password = local.password
|
||||||
}
|
}
|
||||||
|
|
||||||
os_profile_linux_config {
|
os_profile_linux_config {
|
||||||
|
@ -5,7 +5,7 @@ terraform {
|
|||||||
required_providers {
|
required_providers {
|
||||||
azurerm = {
|
azurerm = {
|
||||||
source = "hashicorp/azurerm"
|
source = "hashicorp/azurerm"
|
||||||
version = "~>2.0"
|
version = "~> 3.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -13,3 +13,12 @@ terraform {
|
|||||||
provider "azurerm" {
|
provider "azurerm" {
|
||||||
features {}
|
features {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "random_password" "password" {
|
||||||
|
count = var.password == null ? 1 : 0
|
||||||
|
length = 20
|
||||||
|
}
|
||||||
|
|
||||||
|
locals {
|
||||||
|
password = try(random_password.password[0].result, var.password)
|
||||||
|
}
|
@ -111,7 +111,7 @@ resource "azurerm_virtual_machine" "onprem-vm" {
|
|||||||
os_profile {
|
os_profile {
|
||||||
computer_name = "${local.prefix-onprem}-vm"
|
computer_name = "${local.prefix-onprem}-vm"
|
||||||
admin_username = var.username
|
admin_username = var.username
|
||||||
admin_password = var.password
|
admin_password = local.password
|
||||||
}
|
}
|
||||||
|
|
||||||
os_profile_linux_config {
|
os_profile_linux_config {
|
||||||
|
@ -84,7 +84,7 @@ resource "azurerm_virtual_machine" "spoke1-vm" {
|
|||||||
os_profile {
|
os_profile {
|
||||||
computer_name = "${local.prefix-spoke1}-vm"
|
computer_name = "${local.prefix-spoke1}-vm"
|
||||||
admin_username = var.username
|
admin_username = var.username
|
||||||
admin_password = var.password
|
admin_password = local.password
|
||||||
}
|
}
|
||||||
|
|
||||||
os_profile_linux_config {
|
os_profile_linux_config {
|
||||||
|
@ -88,7 +88,7 @@ resource "azurerm_virtual_machine" "spoke2-vm" {
|
|||||||
os_profile {
|
os_profile {
|
||||||
computer_name = "${local.prefix-spoke2}-vm"
|
computer_name = "${local.prefix-spoke2}-vm"
|
||||||
admin_username = var.username
|
admin_username = var.username
|
||||||
admin_password = var.password
|
admin_password = local.password
|
||||||
}
|
}
|
||||||
|
|
||||||
os_profile_linux_config {
|
os_profile_linux_config {
|
||||||
|
@ -10,6 +10,8 @@ variable "username" {
|
|||||||
|
|
||||||
variable "password" {
|
variable "password" {
|
||||||
description = "Password for Virtual Machines"
|
description = "Password for Virtual Machines"
|
||||||
|
sensitive = true
|
||||||
|
default = null
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "vmsize" {
|
variable "vmsize" {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user