{
        "description": "The base image for various infrastructures",
        "min_packer_version": "0.9.0",
        "variables": {
                "docker_email": "{{env `DOCKER_EMAIL`}}",
                "docker_username": "{{env `DOCKER_USERNAME`}}",
                "docker_password": "{{env `DOCKER_PASSWORD`}}",
                "ansible_staging_directory": "/tmp/packer-provisioner-ansible-local"
        },
        "builders": [
                {
                        "type": "docker",
                        "communicator": "docker",
                        "image": "python:2",
                        "commit": true,
                        "pull": true
                }
        ],
        "_comment1": "Docker builder with ansible-remote can't be used now. (Ref.)https://github.com/mitchellh/packer/issues/3331",
        "_comment2": "Workaround for role update with glob. (Ref.)https://github.com/mitchellh/packer/issues/1000",
        "_comment3": "/usr/bin/python must exists for Ansible provisioning.",
        "provisioners": [
                {
                        "type": "shell",
                        "inline": [
                                "pip install ansible",
                                "mkdir -p {{user `ansible_staging_directory`}}",
                                "if [ ! -e /usr/bin/python -a -e /usr/local/bin/python ]; then /bin/ln -s /usr/local/bin/python /usr/bin/python; fi"
                        ]
                },
                {
                        "type": "file",
                        "source": "roles",
                        "destination": "{{user `ansible_staging_directory`}}"
                },
                {
                        "type": "ansible-local",
                        "playbook_file": "playbooks/base.yml",
                        "staging_directory": "{{user `ansible_staging_directory`}}"
                }
        ],
        "post-processors": [
                {
                        "type": "docker-tag",
                        "repository": "fgtatsuro/infra-bridgehead",
                        "tag": "debian-jessie",
                        "force": true
                },
                {
                        "type": "docker-push",
                        "login": true,
                        "login_email": "{{user `docker_email`}}",
                        "login_username": "{{user `docker_username`}}",
                        "login_password": "{{user `docker_password `}}"
                }
        ]
}

Add a Packer template for basic image.
Add a Packer template for basic image.
