blob: 1b40f24d3f0facc2f943e082a8d68c533355a4ae (
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
68
69
70
|
---
# 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_remote_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: 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: vpc_and_subnet_id.yml
- name: include build compute and infra node groups
include: build_node_group.yml
vars:
l_nodes_to_build: "{{ openshift_aws_node_group_config }}"
l_launch_config_security_groups: "{{ openshift_aws_launch_config_security_groups }}"
l_aws_ami_map: "{{ openshift_aws_ami_map }}"
- name: include build node group for extra nodes
include: build_node_group.yml
when: openshift_aws_node_group_config_extra is defined
vars:
l_nodes_to_build: "{{ openshift_aws_node_group_config_extra | default({}) }}"
l_launch_config_security_groups: "{{ openshift_aws_launch_config_security_groups_extra }}"
l_aws_ami_map: "{{ openshift_aws_ami_map_extra }}"
- when: openshift_aws_wait_for_ssh | bool
block:
- name: pause and allow for instances to scale before we query them
pause:
seconds: 10
- name: fetch newly created instances
ec2_remote_facts:
region: "{{ openshift_aws_region }}"
filters:
"tag:clusterid": "{{ openshift_aws_clusterid }}"
"tag:host-type": node
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 }}"
|