launch.yml 1.9 KB

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