launch.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. os_libvirt_instance_memory_mib: "{{ lookup('oo_option', 'libvirt_instance_memory_mib') | default(1024) }}"
  14. os_libvirt_instance_vcpu: "{{ lookup('oo_option', 'libvirt_instance_vcpu') | default(2) }}"
  15. image_url: "{{ deployment_vars[deployment_type].image.url }}"
  16. image_sha256: "{{ deployment_vars[deployment_type].image.sha256 }}"
  17. image_name: "{{ deployment_vars[deployment_type].image.name }}"
  18. image_compression: "{{ deployment_vars[deployment_type].image.compression }}"
  19. tasks:
  20. - fail: msg="Deployment type not supported for libvirt provider yet"
  21. when: deployment_type == 'online'
  22. - include: tasks/configure_libvirt.yml
  23. - include: ../../common/openshift-cluster/tasks/set_etcd_launch_facts.yml
  24. - include: tasks/launch_instances.yml
  25. vars:
  26. instances: "{{ etcd_names }}"
  27. cluster: "{{ cluster_id }}"
  28. type: "{{ k8s_type }}"
  29. g_sub_host_type: "default"
  30. - include: ../../common/openshift-cluster/tasks/set_master_launch_facts.yml
  31. - include: tasks/launch_instances.yml
  32. vars:
  33. instances: "{{ master_names }}"
  34. cluster: "{{ cluster_id }}"
  35. type: "{{ k8s_type }}"
  36. g_sub_host_type: "default"
  37. - include: ../../common/openshift-cluster/tasks/set_node_launch_facts.yml
  38. vars:
  39. type: "compute"
  40. count: "{{ num_nodes }}"
  41. - include: tasks/launch_instances.yml
  42. vars:
  43. instances: "{{ node_names }}"
  44. cluster: "{{ cluster_id }}"
  45. type: "{{ k8s_type }}"
  46. g_sub_host_type: "{{ sub_host_type }}"
  47. - include: ../../common/openshift-cluster/tasks/set_node_launch_facts.yml
  48. vars:
  49. type: "infra"
  50. count: "{{ num_infra }}"
  51. - include: tasks/launch_instances.yml
  52. vars:
  53. instances: "{{ node_names }}"
  54. cluster: "{{ cluster_id }}"
  55. type: "{{ k8s_type }}"
  56. g_sub_host_type: "{{ sub_host_type }}"
  57. - include: update.yml
  58. - include: list.yml