summaryrefslogtreecommitdiffstats
path: root/roles/openshift_aws/tasks/provision_nodes.yml
blob: d82f185744b66df016067cd889ec9b1798978563 (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
---
# Get bootstrap config token
# bootstrap should be created on first master
# need to fetch it and shove it into cloud data
- name: fetch master instances
  ec2_instance_facts:
    region: "{{ openshift_aws_region }}"
    filters:
      "tag:clusterid": "{{ openshift_aws_clusterid }}"
      "tag:host-type": master
      instance-state-name: running
  register: instancesout
  retries: 20
  delay: 3
  until:
  - "'instances' in instancesout"
  - instancesout.instances|length > 0

- name: slurp down the bootstrap.kubeconfig
  slurp:
    src: /etc/origin/master/bootstrap.kubeconfig
  delegate_to: "{{ instancesout.instances[0].public_ip_address }}"
  remote_user: root
  register: bootstrap

- name: set_fact for kubeconfig token
  set_fact:
    openshift_aws_launch_config_bootstrap_token: "{{ bootstrap['content'] | b64decode }}"

- include_tasks: vpc_and_subnet_id.yml

- name: include build compute and infra node groups
  include_tasks: build_node_group.yml
  with_items: "{{ openshift_aws_node_groups }}"
  vars:
    l_node_group_config: "{{ openshift_aws_node_group_config }}"
  loop_control:
    loop_var: openshift_aws_node_group

# instances aren't scaling fast enough here, we need to wait for them
- when: openshift_aws_wait_for_ssh | bool
  name: wait for our new nodes to come up
  include_tasks: wait_for_groups.yml
  vars:
    created_asgs: "{{ openshift_aws_created_asgs }}"