github-action-playbook.yml 867 B

1234567891011121314151617181920212223242526272829303132333435363738
  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: Basic AMI Creation
  15. amazon.aws.ec2_ami:
  16. instance_id: "{{ instance_id }}"
  17. wait: yes
  18. name: "{{ ami_name }}"
  19. launch_permissions:
  20. group_names: ['all']
  21. tags:
  22. Name: "{{ ami_name }}"
  23. register: ami_data
  24. delegate_to: localhost
  25. - name: Delete the stack
  26. amazon.aws.cloudformation:
  27. stack_name: "{{ stack_name }}"
  28. state: "absent"
  29. delegate_to: localhost
  30. - name: Print AMI ID
  31. debug:
  32. msg: "AMI ID is: {{ ami_data.image_id }}"