Skip to content

azure-arm 2.5.1 incorrectly sets disablePasswordAuthentication false #562

Description

@jazelenk

When filing a bug, please include the following headings.

Please delete the example text in this template before submitting.

Overview of the Issue

When I set communicator=ssh and provide ssh_username and ssh_private_key_file but no password, the VM has properties.osProfile.linuxConfiguration.disablePasswordAuthentication set to false, but it should be true. When I use 2.5.0, I see the correct value (true)

Reproduction Steps

In the 'source "azure-arm"' block, set:
communicator = "ssh"
ssh_username = "..."
ssh_private_key_file = "..."

Do not set ssh_password

While packer runs, do a GET on the VM and observe properties.osProfile.linuxConfiguration

Plugin and Packer version

packer: 1.14.3
plugin: github.com/hashicorp/azure v2.5.1

Simplified Packer Buildfile

packer {
required_plugins {
azure = {
version = ">= 2.5.1"
source = "github.com/hashicorp/azure"
}
}
}

variable "venv_root" {
type = string
}

source "azure-arm" "prelim" {
os_type = "Linux"

polling_duration_timeout = "30m"

disk_caching_type = "ReadOnly"

communicator = "ssh"
ssh_username = "packer"
ssh_private_key_file = "/mnt/vss/_work/_temp/ssh-for-packer/id_rsa"

azure_tags = {
CopyFlag = "CopyV2"
hyperVversion = "2"
owner = "tester"
# https://developer.hashicorp.com/packer/docs/templates/hcl_templates/functions/datetime/formatdate
time_create = formatdate("YYYY-MM-DD hh:mm:ssZZZZ", timestamp())
}

additional settings snipped - not relevant

}

build {
sources = ["sources.azure-arm.prelim"]

provisioner "shell" {
inline = [
"sudo mkdir -p /tmp/prelim",
"sudo chmod 777 /tmp/prelim",
]
}

further provisioners snipped for brevity

}

Operating system and Environment details

OS: Linux Ubuntu 20 (Canonical ESM)
Azure VM

Log Fragments and crash.log files

n/a

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions