Skip to content

Interpolate user variables within other user variables #1942

@brettswift

Description

@brettswift

packer version: 0.7.2

Packer doesn't allow variables to be interpolated into other variables.

This would be helpful when I want to switch to a different version of RHEL for instance, so I could do something like the following:

  "variables": {
    "iso_url": "http://myserver/ISOs/rhel-server-{{ user `rhel_version`}}-x86_64-dvd.iso",
    "iso_checksum": "d717af33dd258945e6304f9955487017",
    "rhel_version": "6.3",
  },

Then via command line just pass in rhel_version.

The only way of getting around this that I can think of now would be to split up the iso_url field into 3 parts, and use the 3 parts everywhere.. which is a little messy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreCore components of Packerenhancementpre-1.0wontfixOut of scope/alignment with the project, or issue is expected, intended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions