packer.json 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. {
  2. "variables": {
  3. "region" : "{{ cookiecutter.aws_region }}"
  4. {% raw -%}
  5. },
  6. "provisioners": [
  7. {
  8. "type" : "shell",
  9. "inline" : [
  10. "/bin/echo 'Your patience will be rewarded'",
  11. "sleep 120",
  12. "sudo apt-get update",
  13. "sudo apt-get -y install curl python python-pip"
  14. ]
  15. },
  16. {
  17. "type" : "ansible",
  18. "playbook_file" : "./ansible/playbook.yml",
  19. "ansible_env_vars": [ "ANSIBLE_HOST_KEY_CHECKING=False", "ANSIBLE_SSH_ARGS='-o IdentitiesOnly=yes -o ControlMaster=auto -o ControlPersist=60s'", "ANSIBLE_NOCOLOR=True" ]
  20. }
  21. ],
  22. "builders": [
  23. {
  24. "type" : "amazon-ebs",
  25. {% endraw -%}
  26. "profile" : "{{ cookiecutter.aws_profile }}",
  27. {% raw -%}
  28. "region" : "{{user `region`}}",
  29. {% endraw -%}
  30. "ssh_username" : "ubuntu",
  31. "instance_type" : "m3.medium",
  32. "source_ami_filter": {
  33. "filters": {
  34. "virtualization-type": "hvm",
  35. "name": "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*",
  36. "root-device-type": "ebs"
  37. },
  38. "owners": ["099720109477"],
  39. "most_recent": true
  40. },
  41. "ami_name" : "{{cookiecutter.packer_name}}-{% raw -%}{{timestamp}}{% endraw -%}",
  42. "tags" : {
  43. "role" : "{{cookiecutter.packer_name}}",
  44. "build_date" : "{% raw -%}{{timestamp}}{% endraw -%}"
  45. }
  46. }
  47. ],
  48. "post-processors": [ ]
  49. }