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

123456789101112131415161718192021222324252627282930313233343536373839
  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 and build
  11. include_role:
  12. name: common
  13. tasks_from: run-setup-build
  14. - name: Install subkey
  15. include_role:
  16. name: admin
  17. tasks_from: main
  18. - name: Basic AMI Creation
  19. amazon.aws.ec2_ami:
  20. instance_id: '{{ instance_id }}'
  21. wait: yes
  22. # How long before wait gives up, in seconds
  23. wait_timeout: 3600
  24. name: '{{ ami_name }}'
  25. launch_permissions:
  26. group_names: ['all']
  27. tags:
  28. Name: '{{ ami_name }}'
  29. register: ami_data
  30. delegate_to: localhost
  31. - name: Print AMI ID
  32. debug:
  33. msg: 'AMI ID is: {{ ami_data.image_id }}'