Skip to content

Shell provisioner does not interpolate "inline" commands before writing them to file. #8835

@SwampDragons

Description

@SwampDragons

The shell-local provisioner interpolates "inline" commands so that users can use template functions directly inside the provisioner.

the shell provisioner does not.

Example:

{
    "builders": [
        {
            "type": "amazon-ebs"
            "ami_name": "packer-whee",
            "instance_type": "t2.micro",
            "source_ami_filter": {
              "filters": {
                "virtualization-type": "hvm",
                "name": "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*",
                "root-device-type": "ebs"
              },
              "owners": ["099720109477"],
              "most_recent": true
            },
            "ssh_username": "ubuntu",
        }
    ],
  "provisioners": [
    {
        "type": "shell-local",
        "inline": ["echo MEGAN packer run uuid is '{{ build `PackerRunUUID`}}'"]
    },
    {
        "type": "shell",
        "inline": ["echo MEGAN packer run uuid is '{{ build `PackerRunUUID`}}'"]
    }
  ]
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions