Skip to content

Commit

Permalink
Merge branch 'AZ-1484' into 'master'
Browse files Browse the repository at this point in the history
AZ-1484 -  linux-vm - cover edge case with admin password

See merge request claranet/projects/cloud/azure/terraform/modules/linux-vm!138
  • Loading branch information
Shr3ps committed Nov 22, 2024
2 parents ff7f2c7 + 968697f commit f5ec81b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ module "vm" {
| default\_tags\_enabled | Option to enable or disable default tags. | `bool` | `true` | no |
| diagnostics\_storage\_account\_name | Name of the Storage Account in which store boot diagnostics and for legacy monitoring agent. | `string` | n/a | yes |
| diagnostics\_storage\_account\_sas\_token | SAS token of the Storage Account in which store vm diagnostics. Used only with legacy monitoring agent, set to `null` if not needed. | `string` | `null` | no |
| disable\_password\_authentication | Option to disable or enable password authentication if admin password is not set | `bool` | `true` | no |
| encryption\_at\_host\_enabled | Should all disks (including the temporary disk) attached to the Virtual Machine be encrypted by enabling Encryption at Host? List of compatible VM sizes: https://learn.microsoft.com/en-us/azure/virtual-machines/linux/disks-enable-host-based-encryption-cli#finding-supported-vm-sizes. | `bool` | `false` | no |
| environment | Project environment. | `string` | n/a | yes |
| extensions\_extra\_tags | Extra tags to set on the VM extensions. | `map(string)` | `{}` | no |
Expand Down
2 changes: 1 addition & 1 deletion r-vm.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "azurerm_linux_virtual_machine" "vm" {
custom_data = var.custom_data
user_data = var.user_data

disable_password_authentication = var.admin_password != null ? false : true
disable_password_authentication = var.admin_password != null ? false : var.disable_password_authentication

dynamic "admin_ssh_key" {
for_each = var.ssh_public_key != null ? ["fake"] : []
Expand Down
7 changes: 7 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -273,3 +273,10 @@ variable "patching_reboot_setting" {
default = "IfRequired"
nullable = false
}

## Disable password authentication
variable "disable_password_authentication" {
description = "Option to disable or enable password authentication if admin password is not set"
type = bool
default = true
}

0 comments on commit f5ec81b

Please sign in to comment.