Skip to content

Update GCP packer plugin - #355

Open
duncanspani wants to merge 1 commit into
hashicorp:mainfrom
duncanspani:patch-1
Open

Update GCP packer plugin#355
duncanspani wants to merge 1 commit into
hashicorp:mainfrom
duncanspani:patch-1

Conversation

@duncanspani

Copy link
Copy Markdown

Get instance name via metadata server instead of using ${HOSTNAME}

Some Linux distros on GCP allows the ${HOSTNAME} to resolve to the FQDN by default (ie: {NAME}.{ZONE}.c.{PROJECT}.internal) which causes the startup script to throw an error during completion, even if all other tasks were successful. This errors results in the metadata never being updated and the startup script running forever.

This change removes the only reference to the HOSTNAME env var, and replaces it with the name returned by the GCP metadata server (similar to ZONE in this same file).

Get instance name via metadata server instead of using ${HOSTNAME}

Depending on the OS, ${HOSTNAME} can resolve to the FQDN (ie: `{NAME}.{ZONE}.c.{PROJECT}.internal`) which causes the startup script to fail during completion, even if all other tasks were successful.
@duncanspani
duncanspani requested a review from a team as a code owner July 29, 2026 03:28
@hashicorp-cla-app

hashicorp-cla-app Bot commented Jul 29, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant