summaryrefslogtreecommitdiffstats
path: root/roles/openshift_aws/tasks/provision.yml
blob: e99017b9fed48238a678f94a5d1da808eb4139dd (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
---
- when: openshift_aws_create_iam_cert | bool
  name: create the iam_cert for elb certificate
  include: iam_cert.yml

- when: openshift_aws_create_s3 | bool
  name: create s3 bucket for registry
  include: s3.yml

- when: openshift_aws_create_security_groups
  block:
  - name: "Create {{ openshift_aws_node_group_type }} security groups"
    include: security_group.yml

  - name: "Create {{ openshift_aws_node_group_type }} security groups"
    include: security_group.yml
    vars:
      openshift_aws_node_group_type: infra

- name: create our master internal load balancer
  include: elb.yml
  vars:
    openshift_aws_elb_direction: internal
    openshift_aws_elb_scheme: internal
    l_openshift_aws_elb_name: "{{ openshift_aws_elb_name_dict[openshift_aws_node_group_type]['internal'] }}"

- name: create our master external load balancer
  include: elb.yml
  vars:
    openshift_aws_elb_direction: external
    openshift_aws_elb_scheme: internet-facing
    l_openshift_aws_elb_name: "{{ openshift_aws_elb_name_dict[openshift_aws_node_group_type]['external'] }}"

- name: create our infra node external load balancer
  include: elb.yml
  vars:
    l_openshift_aws_elb_name: "{{ openshift_aws_elb_name_dict['infra']['external'] }}"
    openshift_aws_elb_direction: external
    openshift_aws_elb_scheme: internet-facing
    openshift_aws_node_group_type: infra

- name: include scale group creation for master
  include: build_node_group.yml

- name: fetch newly created instances
  ec2_remote_facts:
    region: "{{ openshift_aws_region }}"
    filters:
      "tag:clusterid": "{{ openshift_aws_clusterid }}"
      "tag:host-type": "{{ openshift_aws_node_group_type }}"
      instance-state-name: running
  register: instancesout
  retries: 20
  delay: 3
  until: instancesout.instances|length > 0

- name: wait for ssh to become available
  wait_for:
    port: 22
    host: "{{ item.public_ip_address }}"
    timeout: 300
    search_regex: OpenSSH
  with_items: "{{ instancesout.instances }}"
  when: openshift_aws_wait_for_ssh | bool