launch.yml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. ---
  2. - name: Launch instance(s)
  3. hosts: localhost
  4. connection: local
  5. become: no
  6. gather_facts: no
  7. vars_files:
  8. - vars.yml
  9. tasks:
  10. - fail: msg="Deployment type not supported for gce provider yet"
  11. when: deployment_type == 'enterprise'
  12. - include: ../../common/openshift-cluster/tasks/set_etcd_launch_facts.yml
  13. - include: tasks/launch_instances.yml
  14. vars:
  15. instances: "{{ etcd_names }}"
  16. cluster: "{{ cluster_id }}"
  17. type: "{{ k8s_type }}"
  18. g_sub_host_type: "default"
  19. gce_machine_type: "{{ lookup('env', 'gce_machine_etcd_type') | default(lookup('env', 'gce_machine_type'), true) }}"
  20. gce_machine_image: "{{ lookup('env', 'gce_machine_etcd_image') | default(lookup('env', 'gce_machine_image'), true) }}"
  21. - include: ../../common/openshift-cluster/tasks/set_master_launch_facts.yml
  22. - include: tasks/launch_instances.yml
  23. vars:
  24. instances: "{{ master_names }}"
  25. cluster: "{{ cluster_id }}"
  26. type: "{{ k8s_type }}"
  27. g_sub_host_type: "default"
  28. gce_machine_type: "{{ lookup('env', 'gce_machine_master_type') | default(lookup('env', 'gce_machine_type'), true) }}"
  29. gce_machine_image: "{{ lookup('env', 'gce_machine_master_image') | default(lookup('env', 'gce_machine_image'), true) }}"
  30. - include: ../../common/openshift-cluster/tasks/set_node_launch_facts.yml
  31. vars:
  32. type: "compute"
  33. count: "{{ num_nodes }}"
  34. - include: tasks/launch_instances.yml
  35. vars:
  36. instances: "{{ node_names }}"
  37. cluster: "{{ cluster_id }}"
  38. type: "{{ k8s_type }}"
  39. g_sub_host_type: "{{ sub_host_type }}"
  40. gce_machine_type: "{{ lookup('env', 'gce_machine_node_type') | default(lookup('env', 'gce_machine_type'), true) }}"
  41. gce_machine_image: "{{ lookup('env', 'gce_machine_node_image') | default(lookup('env', 'gce_machine_image'), true) }}"
  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. gce_machine_type: "{{ lookup('env', 'gce_machine_node_type') | default(lookup('env', 'gce_machine_type'), true) }}"
  53. gce_machine_image: "{{ lookup('env', 'gce_machine_node_image') | default(lookup('env', 'gce_machine_image'), true) }}"
  54. - add_host:
  55. name: "{{ master_names.0 }}"
  56. groups: service_master
  57. when: master_names is defined and master_names.0 is defined
  58. - include: update.yml
  59. - include: list.yml