Ansible-Local and ansible_env_vars

Skip to first unread message

Eddie Dunn

Jun 25, 2021, 10:45:17 AMJun 25
to Packer

I am trying to use ansible-local with packer 1.7.2 and pass in some env vars.
In the documentation it states that ansible_env_vars is an option for ansible-local.

I cannot however get it to recognize the option and I get an error ("ansible_env_vars" is not expected here.)

Here is a snippet:
  provisioner "ansible-local" {
    playbook_file  = "..."
    playbook_dir   = ".."
    inventory_file = ".."
    group_vars     = ".."
    host_vars      = ".."
    ansible_env_vars = ["VAR=${var.var}",

Anyone have any idea why this is not working?


Megan Marsh

Jun 28, 2021, 5:33:25 PMJun 28
Hmm, that doesn't seem right. Can you open a bug on the ansible plugin repo?

This mailing list is governed under the HashiCorp Community Guidelines - Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues:
IRC: #packer-tool on Freenode
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages