create-joystream-node-ami-playbook.yml 969 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ---
  2. # Setup joystream code, build and Create AMI
  3. - name: Setup instance
  4. hosts: all
  5. tasks:
  6. - name: Get code from git repo
  7. include_role:
  8. name: common
  9. tasks_from: get-code-git
  10. - name: Run setup
  11. include_role:
  12. name: common
  13. tasks_from: run-setup
  14. - name: Run build
  15. include_role:
  16. name: common
  17. tasks_from: run-build
  18. - name: Install subkey
  19. include_role:
  20. name: build-server
  21. tasks_from: main
  22. - name: Basic AMI Creation
  23. amazon.aws.ec2_ami:
  24. instance_id: '{{ instance_id }}'
  25. wait: yes
  26. # How long before wait gives up, in seconds
  27. wait_timeout: 3600
  28. name: '{{ ami_name }}'
  29. launch_permissions:
  30. group_names: ['all']
  31. tags:
  32. Name: '{{ ami_name }}'
  33. register: ami_data
  34. delegate_to: localhost
  35. - name: Print AMI ID
  36. debug:
  37. msg: 'AMI ID is: {{ ami_data.image_id }}'