summaryrefslogtreecommitdiffstats
path: root/playbooks/gce/openshift-cluster/launch.yml
blob: 7532a678bc1b5953a08c3ac3748e0d51abc3d0ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
- name: Launch instance(s)
  hosts: localhost
  connection: local
  become: no
  gather_facts: no
  vars_files:
  - vars.yml
  tasks:
  - fail: msg="Deployment type not supported for gce provider yet"
    when: deployment_type == 'enterprise'

  - include: ../../common/openshift-cluster/tasks/set_etcd_launch_facts.yml
  - include: tasks/launch_instances.yml
    vars:
      instances: "{{ etcd_names }}"
      cluster: "{{ cluster_id }}"
      type: "{{ k8s_type }}"
      g_sub_host_type: "default"
      gce_machine_type: "{{ lookup('env', 'gce_machine_etcd_type') | default(lookup('env', 'gce_machine_type'), true) }}"
      gce_machine_image: "{{ lookup('env', 'gce_machine_etcd_image') | default(lookup('env', 'gce_machine_image'), true) }}"


  - include: ../../common/openshift-cluster/tasks/set_master_launch_facts.yml
  - include: tasks/launch_instances.yml
    vars:
      instances: "{{ master_names }}"
      cluster: "{{ cluster_id }}"
      type: "{{ k8s_type }}"
      g_sub_host_type: "default"
      gce_machine_type: "{{ lookup('env', 'gce_machine_master_type') | default(lookup('env', 'gce_machine_type'), true) }}"
      gce_machine_image: "{{ lookup('env', 'gce_machine_master_image') | default(lookup('env', 'gce_machine_image'), true) }}"

  - include: ../../common/openshift-cluster/tasks/set_node_launch_facts.yml
    vars:
      type: "compute"
      count: "{{ num_nodes }}"
  - include: tasks/launch_instances.yml
    vars:
      instances: "{{ node_names }}"
      cluster: "{{ cluster_id }}"
      type: "{{ k8s_type }}"
      g_sub_host_type: "{{ sub_host_type }}"
      gce_machine_type: "{{ lookup('env', 'gce_machine_node_type') | default(lookup('env', 'gce_machine_type'), true) }}"
      gce_machine_image: "{{ lookup('env', 'gce_machine_node_image') | default(lookup('env', 'gce_machine_image'), true) }}"

  - include: ../../common/openshift-cluster/tasks/set_node_launch_facts.yml
    vars:
      type: "infra"
      count: "{{ num_infra }}"
  - include: tasks/launch_instances.yml
    vars:
      instances: "{{ node_names }}"
      cluster: "{{ cluster_id }}"
      type: "{{ k8s_type }}"
      g_sub_host_type: "{{ sub_host_type }}"
      gce_machine_type: "{{ lookup('env', 'gce_machine_node_type') | default(lookup('env', 'gce_machine_type'), true) }}"
      gce_machine_image: "{{ lookup('env', 'gce_machine_node_image') | default(lookup('env', 'gce_machine_image'), true) }}"

  - add_host:
      name: "{{ master_names.0 }}"
      groups: service_master
    when: master_names is defined and master_names.0 is defined

- include: update.yml

- include: list.yml