{
  "variables": {
    "aws_access_key": "",
    "aws_secret_key": ""
  },
  "builders": [{
    "type": "amazon-ebs",
    "access_key": "{{user `aws_access_key`}}",
    "secret_key": "{{user `aws_secret_key`}}",
    "region": "us-east-1",
    "source_ami": "ami-d05e75b8",
    "instance_type": "t2.small",
    "ssh_username": "ubuntu",
    "ami_name": "webserver-dev-{{timestamp}}"
  }],
  "provisioners": [
        {
            "type": "shell",
            "execute_command": "echo 'vagrant' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'",
            "inline": [
                "sleep 30",
                "apt-add-repository ppa:rquillo/ansible",
                "/usr/bin/apt-get update",
                "/usr/bin/apt-get -y install openssl libssl-dev libssl-doc build-essential libffi-dev python-dev python-pip",
                "pip install ansible==1.9.4"
            ]
        },
        {
            "type": "ansible-local",
            "playbook_dir": ".",
            "playbook_file": "webservers-dev-packer.yml",
            "role_paths": [
                "roles/"
            ]
        }
    ]
}

{
  "variables": {
    "aws_access_key": "",
    "aws_secret_key": ""
  },
  "builders": [{
    "type": "amazon-ebs",
    "access_key": "{{user `aws_access_key`}}",
    "secret_key": "{{user `aws_secret_key`}}",
    "region": "us-east-1",
    "source_ami": "ami-d05e75b8",
    "instance_type": "t2.small",
    "ssh_username": "ubuntu",
    "ami_name": "webserver-dev-{{timestamp}}"
  }],
  "provisioners": [
        {
            "type": "shell",
            "execute_command": "echo 'vagrant' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'",
            "inline": [
                "sleep 30",
                "apt-add-repository ppa:rquillo/ansible",
                "/usr/bin/apt-get update",
                "/usr/bin/apt-get -y install openssl libssl-dev libssl-doc build-essential libffi-dev python-dev python-pip",
                "pip install ansible==1.9.4"
            ]
        },
        {
            "type": "ansible-local",
            "playbook_dir": ".",
            "playbook_file": "webservers-dev-packer.yml",
            "role_paths": [
                "roles/"
            ]
        }
    ],
  "post-processors": [
      {
      "type": "manifest",
      "output": "manifest.json",
      "strip_path": true
    }
  ]
}

Enable the manifest post processor for packer.
Enable the manifest post processor for packer.
