summaryrefslogtreecommitdiffstats
path: root/playbooks/aws/openshift-cluster/provision_nodes.yml
blob: 87629e3549ca84995b4dcabe3edcaf8f45df5ce6 (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
---
# Get bootstrap config token
# bootstrap should be created on first master
# need to fetch it and shove it into cloud data
- name: create the node scale groups
  hosts: localhost
  connection: local
  gather_facts: yes
  tasks:
  - name: get provisioning vars
    include_vars: vars.yml

  - name: fetch master instances
    ec2_remote_facts:
      region: "{{ provision.region }}"
      filters:
        "tag:clusterid": "{{ provision.clusterid }}"
        "tag:host-type": master
        instance-state-name: running
    register: instancesout
    retries: 20
    delay: 3
    until: 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 on localhost for kubeconfig
    set_fact:
      local_bootstrap: "{{ bootstrap }}"
      launch_config_name:
        infra: "infra-{{ ansible_date_time.epoch }}"
        compute: "compute-{{ ansible_date_time.epoch }}"

  - name: include build node group for infra
    include: build_node_group.yml
    vars:
      openshift_build_node_type: infra
      openshift_clusterid: "{{ provision.clusterid }}"
      openshift_region: "{{ provision.region }}"
      openshift_use_custom_ami: "{{ proviion.use_custom_ami }}"
      openshift_ami_name: "{{ provision.build.ami_name }}"
      openshift_ami_tags: "{{ provision.build.openshift_ami_tags }}"
      openshift_node_group_config: "{{ provision.node_group_config }}"
      openshift_subnet_name: "{{ provision.vpc.subnets[provision.region][0].az }}"


  - name: include build node group for compute
    include: build_node_group.yml
    vars:
      openshift_build_node_type: compute
      openshift_clusterid: "{{ provision.clusterid }}"
      openshift_region: "{{ provision.region }}"
      openshift_use_custom_ami: "{{ proviion.use_custom_ami }}"
      openshift_ami_name: "{{ provision.build.ami_name }}"
      openshift_ami_tags: "{{ provision.build.openshift_ami_tags }}"
      openshift_node_group_config: "{{ provision.node_group_config }}"
      openshift_subnet_name: "{{ provision.vpc.subnets[provision.region][0].az }}"