forked from openshift-metal3/dev-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vm_setup_vars.yml
89 lines (78 loc) · 3.79 KB
/
vm_setup_vars.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Here we put the ansible vars to override some defaults in the vm-setup
# playbooks/roles, ref https://github.com/metal3-io/metal3-dev-env
# Currently this is required because of hard-coded node-name expectations in the
# openshift-installer terraform templates
ironic_prefix: "{{ ironic_prefix }}"
# We enable more memory and masters in dev-scripts compared to the minimal setup
# in metal3-dev-env
num_masters: 3
num_workers: 1
num_extraworkers: 0
extradisks_list: "{{ lookup('env', 'VM_EXTRADISKS_LIST').split(' ') | default(['vdb']) }}"
extradisks_size: "{{ lookup('env', 'VM_EXTRADISKS_SIZE') | default(['8G']) }}"
flavors:
master:
memory: "{{ lookup('env', 'MASTER_MEMORY') }}"
disk: "{{ lookup('env', 'MASTER_DISK') }}"
vcpu: "{{ lookup('env', 'MASTER_VCPU') }}"
extradisks: "{{ lookup('env', 'VM_EXTRADISKS') | default(false) }}"
worker:
memory: "{{ lookup('env', 'WORKER_MEMORY') }}"
disk: "{{ lookup('env', 'WORKER_DISK') }}"
vcpu: "{{ lookup('env', 'WORKER_VCPU') }}"
extradisks: "{{ lookup('env', 'VM_EXTRADISKS') | default(false) }}"
extraworker:
memory: "{{ lookup('env', 'EXTRA_WORKER_MEMORY') }}"
disk: "{{ lookup('env', 'EXTRA_WORKER_DISK') }}"
vcpu: "{{ lookup('env', 'EXTRA_WORKER_VCPU') }}"
extradisks: "{{ lookup('env', 'VM_EXTRADISKS') | default(false) }}"
# For OpenShift we create some additional DNS records for the API/DNS VIPs
baremetal_network_cidr_v4: "{{ lookup('env', 'EXTERNAL_SUBNET_V4') }}"
baremetal_network_cidr_v6: "{{ lookup('env', 'EXTERNAL_SUBNET_V6') }}"
baremetal_network_cidr: "{{ baremetal_network_cidr_v4 | default(baremetal_network_cidr_v6, true) }}"
dns_dualstackhost:
- ip: "{{ baremetal_network_cidr_v6 | nthhost(5) }}"
hostnames:
- "api"
dns_extrahosts:
- ip: "{{ baremetal_network_cidr | nthhost(5) }}"
hostnames:
- "api"
- ip: "{{ baremetal_network_cidr | nthhost(2) }}"
hostnames:
- "ns1"
- ip: "{{ baremetal_network_cidr | nthhost(1) }}"
hostnames:
- "virthost"
network_config_folder: "{{ lookup('env', 'NETWORK_CONFIG_FOLDER') | default(false) }}"
hosts_config: "{{ lookup('template', network_config_folder + '/hosts.yaml', errors='ignore') | default('[]', true) | from_yaml }}"
dns_customhosts: "{{ [] if not network_config_folder else hosts_config }}"
provisioning_network:
- name: "{{ provisioning_network_name }}"
bridge: "{{ provisioning_network_name }}"
forward_mode: bridge
external_network:
- name: "{{ baremetal_network_name }}"
bridge: "{{ baremetal_network_name }}"
forward_mode: "{{ 'bridge' if lookup('env', 'MANAGE_BR_BRIDGE') == 'n' else 'nat' if not lookup('env', 'INSTALLER_PROXY') else 'route'}}"
address_v4: "{{ baremetal_network_cidr_v4|nthhost(1)|default('', true) }}"
netmask_v4: "{{ baremetal_network_cidr_v4|ipaddr('netmask') }}"
address_v6: "{{ baremetal_network_cidr_v6|nthhost(1)|default('', true) }}"
prefix_v6: "{{ baremetal_network_cidr_v6|ipaddr('prefix') }}"
dhcp_range_v4:
- "{{ baremetal_network_cidr_v4|nthhost(20) }}"
- "{{ baremetal_network_cidr_v4|nthhost(60) }}"
dhcp_range_v6:
- "{{ baremetal_network_cidr_v6|nthhost(20) }}"
- "{{ baremetal_network_cidr_v6|nthhost(60) }}"
lease_expiry: "{{ lookup('env', 'DHCP_LEASE_EXPIRY') }}"
nat_port_range:
- 1024
- 65535
domain: "{{ cluster_domain }}"
dns:
hosts: "{{ dns_extrahosts + dns_customhosts + dns_dualstackhost if lookup('env', 'EXTERNAL_SUBNET_V6') else dns_extrahosts + dns_customhosts }}"
forwarders:
- domain: "apps.{{ cluster_domain }}"
addr: "127.0.0.1"
networks: "{{ provisioning_network + external_network + (extra_networks | default([])) if not lookup('env', 'BOND_PRIMARY_INTERFACE') else provisioning_network + external_network + external_network + (extra_networks | default([])) }}"