{
  "variables": {
[[#each packerVariables]]    "[[name]]": "{{env `[[name]]`}}"[[#unless @last]],
[[/unless]][[/each]]
  },
  "builders": [
[[#each builders]]    [[[this]]][[#unless @last]],
[[/unless]][[/each]]
  ],
  "provisioners": [
    {
      "type": "shell",
      "inline": [
        "sleep 30",
        "sudo bash -c 'DEBIAN_FRONTEND=noninteractive apt-get -y update'",
        "sudo bash -c 'DEBIAN_FRONTEND=noninteractive apt-get -y upgrade'",
        "sudo bash -c 'DEBIAN_FRONTEND=noninteractive apt-get -y install python3 python3-pip virtualenv'",
        "sudo pip3 install setuptools psycopg2-binary ansible"
      ]
    },
    {
      "type": "ansible-local",
      "playbook_file": "packer-playbook.yml",
      "role_paths": [ [[#each roles]]"roles/[[this]]"[[#unless @last]], [[/unless]][[/each]] ],
      "inventory_file": "hosts"
    }
  ],
  "post-processors": [
    {
      "type": "manifest",
      "output": "manifest.json"
    }
  ]
}
