launch.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ---
  2. - name: Launch instance(s)
  3. hosts: localhost
  4. become: no
  5. connection: local
  6. gather_facts: no
  7. vars_files:
  8. - vars.yml
  9. vars:
  10. os_libvirt_storage_pool: "{{ libvirt_storage_pool | default('images') }}"
  11. os_libvirt_storage_pool_path: "{{ libvirt_storage_pool_path | default('/var/lib/libvirt/images') }}"
  12. os_libvirt_network: "{{ libvirt_network | default('default') }}"
  13. image_url: "{{ deployment_vars[deployment_type].image.url }}"
  14. image_sha256: "{{ deployment_vars[deployment_type].image.sha256 }}"
  15. image_name: "{{ deployment_vars[deployment_type].image.name }}"
  16. image_compression: "{{ deployment_vars[deployment_type].image.compression }}"
  17. tasks:
  18. - fail: msg="Deployment type not supported for libvirt provider yet"
  19. when: deployment_type == 'online'
  20. - include: tasks/configure_libvirt.yml
  21. - include: ../../common/openshift-cluster/tasks/set_etcd_launch_facts.yml
  22. - include: tasks/launch_instances.yml
  23. vars:
  24. instances: "{{ etcd_names }}"
  25. cluster: "{{ cluster_id }}"
  26. type: "{{ k8s_type }}"
  27. g_sub_host_type: "default"
  28. - include: ../../common/openshift-cluster/tasks/set_master_launch_facts.yml
  29. - include: tasks/launch_instances.yml
  30. vars:
  31. instances: "{{ master_names }}"
  32. cluster: "{{ cluster_id }}"
  33. type: "{{ k8s_type }}"
  34. g_sub_host_type: "default"
  35. - include: ../../common/openshift-cluster/tasks/set_node_launch_facts.yml
  36. vars:
  37. type: "compute"
  38. count: "{{ num_nodes }}"
  39. - include: tasks/launch_instances.yml
  40. vars:
  41. instances: "{{ node_names }}"
  42. cluster: "{{ cluster_id }}"
  43. type: "{{ k8s_type }}"
  44. g_sub_host_type: "{{ sub_host_type }}"
  45. - include: ../../common/openshift-cluster/tasks/set_node_launch_facts.yml
  46. vars:
  47. type: "infra"
  48. count: "{{ num_infra }}"
  49. - include: tasks/launch_instances.yml
  50. vars:
  51. instances: "{{ node_names }}"
  52. cluster: "{{ cluster_id }}"
  53. type: "{{ k8s_type }}"
  54. g_sub_host_type: "{{ sub_host_type }}"
  55. - include: update.yml
  56. - include: list.yml