Packer: Packer should be able to prompt for passwords

Created on 9 Dec 2019  路  1Comment  路  Source: hashicorp/packer

Packer should prompt user to enter password when using a password protected private key file instead of throwing an error message.

Feature Description

nice to have

Use Case(s)

packer validate myfile.yml
packer build myfile.yml

Configuration used

...
"builders": [
{
"type": "provider",
"organization_id": "{{ user organization_id }}",
"api_token": "{{ user api_token }}",
"image": "{{ user image_name }}",
"region": "par1",
"commercial_type": "GPU1-M",
"ssh_private_key_file": "< PATH TO A PASSWORD PROTECTED KEY FILE >",
"ssh_username": "root"
}
],
...

enhancement help wanted

Most helpful comment

Hi, thanks for reaching out.

For some context on why we haven't prioritized creating this, most people use Packer as part of a CI pipeline. A Packer build is triggered by a script, and there is no human around to enter a password. In this situation (which represents a majority of Packer runs), hanging indefinitely until a password is entered is not a desirable behavior.

That said, I'd consider merging a change to add this prompt if if was hidden behind a CLI flag. For example, packer build --ask-password example.json I don't think it's something the team is going to get a chance to work on any time soon, but I'd happily review a community pull request for it.

>All comments

Hi, thanks for reaching out.

For some context on why we haven't prioritized creating this, most people use Packer as part of a CI pipeline. A Packer build is triggered by a script, and there is no human around to enter a password. In this situation (which represents a majority of Packer runs), hanging indefinitely until a password is entered is not a desirable behavior.

That said, I'd consider merging a change to add this prompt if if was hidden behind a CLI flag. For example, packer build --ask-password example.json I don't think it's something the team is going to get a chance to work on any time soon, but I'd happily review a community pull request for it.

Was this page helpful?
0 / 5 - 0 ratings