{ "variables": { "region" : "{{ cookiecutter.aws_region }}" {% raw -%} }, "provisioners": [ { "type" : "shell", "inline" : [ "/bin/echo 'Your patience will be rewarded'", "sleep 120", "sudo apt-get update", "sudo apt-get -y install curl python python-pip" ] }, { "type" : "ansible", "playbook_file" : "./ansible/playbook.yml", "ansible_env_vars": [ "ANSIBLE_HOST_KEY_CHECKING=False", "ANSIBLE_SSH_ARGS='-o IdentitiesOnly=yes -o ControlMaster=auto -o ControlPersist=60s'", "ANSIBLE_NOCOLOR=True" ] } ], "builders": [ { "type" : "amazon-ebs", {% endraw -%} "profile" : "{{ cookiecutter.aws_profile }}", {% raw -%} "region" : "{{user `region`}}", {% endraw -%} "ssh_username" : "ubuntu", "instance_type" : "m3.medium", "source_ami_filter": { "filters": { "virtualization-type": "hvm", "name": "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*", "root-device-type": "ebs" }, "owners": ["099720109477"], "most_recent": true }, "ami_name" : "{{cookiecutter.packer_name}}-{% raw -%}{{timestamp}}{% endraw -%}", "tags" : { "role" : "{{cookiecutter.packer_name}}", "build_date" : "{% raw -%}{{timestamp}}{% endraw -%}" } } ], "post-processors": [ ] }