title: Parallel builds using identical json file
body: <p>I have a base AMI which contains java and tomcat (<code>ami-c1f3e7a6</code>). My application stack consists of 6 separate java apps based on my base AMI, and I am using packer to create the 6 separate AMIs. The ansible playbook <code>app_playbook.yml</code>downloads the war file from S3 straight into the tomcat/webapps directory. My packer JSON is:</p>
  
  <pre><code>{
      "variables": {
          "war_file": ""
      },
      "builders": [{
          "type": "amazon-ebs",
          "region": "eu-west-1",
          "source_ami": "ami-c1f3e7a6",
          "instance_type": "t2.small",
          "ssh_username": "ec2-user",
          "ami_name": "app-{{user `war_file`}}-{{timestamp}}"
      }],
      "provisioners": [{
          "type": "ansible",
          "playbook_file": "ansible/app_playbook.yml",
          "extra_arguments": "--extra-vars 'war_file={{user `war_file`}}'"
      }]
  }
  </code></pre>
  
  <p>At the command line I am doing:</p>
  
  <pre><code>packer build -var 'war_file=release123/application_1.war' tomcat.json
  packer build -var 'war_file=release123/application_2.war' tomcat.json
  packer build -var 'war_file=release123/application_3.war' tomcat.json
  packer build -var 'war_file=release123/application_4.war' tomcat.json
  packer build -var 'war_file=release123/application_5.war' tomcat.json
  packer build -var 'war_file=release123/application_6.war' tomcat.json
  </code></pre>
  
  <p>I have been looking into packer's ability to perform parallel builds to speed up the build process but it looks like the provisioner is run against every builder, and I need a specific variable passed into each builder.</p>
  
  <p>I know I could fork the bash commands to execute the builds in parallel, but I feel like there must be a "packer" way of doing this. Any ideas?</p>