-
Notifications
You must be signed in to change notification settings - Fork 11
/
11-provision-vm-bootstrap.yml
70 lines (62 loc) · 2.38 KB
/
11-provision-vm-bootstrap.yml
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
---
- import_playbook: includes/rhcos-preflight.yml
vars:
installer_target: bootstrap
- name: provision the bootstrap vm
hosts: hypervisors
become: yes
gather_facts: no
vars:
current_vm_name: bootstrap
tasks:
- name: set some facts that describe the vm
set_fact:
current_vm_hostname: "{{ vms[current_vm_name].hostname }}"
current_vm_mac: "{{ vms[current_vm_name].mac }}"
current_vm_ipaddr: "{{ vms[current_vm_name].ipaddr }}"
current_vm_netmask: "{{ vms[current_vm_name].netmask | default(vms.global.netmask) }}"
current_vm_dns: "{{ vms[current_vm_name].dns | default(vms.global.dns) }}"
current_vm_gw: "{{ vms[current_vm_name].gw | default(vms.global.gw) }}"
current_vm_tz: "{{ vms[current_vm_name].tz | default(vms.global.tz) }}"
current_vm_mem_gb: "{{ vms[current_vm_name].mem_gb | default(vms.global.mem_gb) }}"
current_vm_ncpus: "{{ vms[current_vm_name].ncpus | default(vms.global.ncpus) }}"
- name: destroy and kill any existing VM
include_tasks: includes/destroy-and-kill-vm.yml
- name: remove and recreate the disk image
include_tasks: includes/remove-and-recreate-disk.yml
- name: create and boot the VM
include_tasks: includes/create-and-boot-vm.yml
- name: warn about accessibility
debug:
msg: >
If you have not yet, this would be a good time to configure and start
your VPN connection to the services VM as the cluster nodes will
probably be unreachable directly with this networking configuration.
when: vm_svc_add_interface | default(false)
- name: wait for the VM to come back after installation
delegate_to: localhost
become: no
wait_for:
host: "{{ current_vm_hostname }}"
port: 22
delay: 10
sleep: 10
timeout: 600
search_regex: OpenSSH
state: started
- name: now wait for stage mco-bootstrap to finish
delegate_to: "{{ current_vm_hostname }}"
become: no
file:
path: /opt/openshift/mco-bootstrap.done
state: file
register: mco_reached
until: not mco_reached.failed
delay: 15
retries: 20
- name: report success
debug:
msg: >
The bootstrap VM has reached the stage where it is safe to proceed
with the master VM deployment. Feel free to do so next.
...