vmware-samples / packer-examples-for-vsphere

Packer Examples for vSphere
https://vmware-samples.github.io/packer-examples-for-vsphere/
Other
798 stars 318 forks source link

[BUG] Setting the `build_password` using `set-envvars.sh` #197

Closed evilaliv3 closed 2 years ago

evilaliv3 commented 2 years ago

Code of Conduct

Project Version

main

VMware vSphere

7.0 Update 2

HashiCorp Packer

v1.8.0

HashiCorp Packer Plugin for VMware vSphere

v1.0.3

Guest Operating System

Any Supported

Environment Details

The current packer templates seem to not use the build_passwordvariable so that the only password read by packer is the one that the user provides in the install script

I've noticed this situation while working on creating a Debian template starting from the existing template for Ubuntu 18.04.

In order to fix this issue and use the build_password variable provided within the set-envvars.sh script the following instruction should be added to the templates:

build_password = var.build_password

Description

-

Expected Behavior

-

Actual Behavior

-

Steps to Reproduce

Run a build setting a password buid_password in the config file as "password" Run the set-envvars.sh script and set the password to "different_password" Run the build.

Result: the password used by packer will be "password" and not "different_password" as expected.

Log Fragments and Files

No response

Screenshots

No response

Additional Context

-

evilaliv3 commented 2 years ago

Looking at the code i think this change shall be applied to alle the Linux distributions.

I'm instead not sure what to do for the rest of the operating systems.

tenthirtyam commented 2 years ago

I'll take a look at it soon and address it. I updated the formatting and data in the originating bug content.

Ryan Johnson Staff II Solutions Architect | VMware, Inc.

github-actions[bot] commented 2 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.