-
Notifications
You must be signed in to change notification settings - Fork 526
Expand file tree
/
Copy pathinstall-config.yaml.j2
More file actions
174 lines (173 loc) · 6.7 KB
/
Copy pathinstall-config.yaml.j2
File metadata and controls
174 lines (173 loc) · 6.7 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
---
apiVersion: v1
metadata:
name: {{ cluster_name | to_json }}
baseDomain: {{ ocp4_base_domain | to_json }}
{% if ocp4_cpu_partitioning_mode is defined %}
cpuPartitioningMode: {{ ocp4_cpu_partitioning_mode | to_json }}
{% endif %}
fips: {{ ocp4_fips_enable | bool | to_json }}
controlPlane:
name: master
hyperthreading: Enabled
{% if ocp4_architecture_cluster is match('arm64') %}
architecture: arm64
{% endif %}
platform:
{% if cloud_provider == 'ec2' %}
{% if custom_image is defined and custom_image.image_id is defined %}
ImageId: {{ custom_image.image_id | to_json }}
{% endif %}
aws:
type: {{ master_instance_type | to_json }}
{% if hostvars.localhost.openshift_controlplane_aws_zones_odcr | default([]) | length > 0 %}
zones: {{ hostvars.localhost.openshift_controlplane_aws_zones_odcr | unique | to_json }}
{% endif %}
rootVolume:
type: {{ master_storage_type | to_json }}
size: {{ master_storage_size | int }}
{% if master_storage_type in ['io1', 'io2'] %}
iops: {{ master_storage_iops | default(host_ocp4_installer_master_storage_iops) | int | to_json }}
{% endif %}
{% endif %}
{% if cloud_provider == 'azure' %}
azure:
type: {{ master_instance_type | to_json }}
{% endif %}
{% if cloud_provider == 'gcp' %}
gcp:
type: {{ master_instance_type | to_json }}
{% endif %}
{% if cloud_provider == 'osp' %}
openstack:
type: {{ master_instance_type | to_json }}
{% if master_storage_type is defined and master_storage_size is defined%}
rootVolume:
type: {{ master_storage_type | to_json }}
size: {{ master_storage_size | to_json }}
{% endif %}
{% endif %}
{% if cloud_provider == 'vmc' and master_instance_cpu is defined and worker_instance_memory_mb is defined %}
vsphere:
cpus: {{ master_instance_cpu | to_json }}
memoryMB: {{ master_instance_memory_mb | to_json }}
{% endif %}
replicas: {{ master_instance_count | int }}
compute:
- name: worker
hyperthreading: Enabled
{% if ocp4_architecture_cluster is match('arm64') %}
architecture: arm64
{% endif %}
platform:
{% if cloud_provider == 'ec2' %}
{% if custom_image is defined and custom_image.image_id is defined %}
ImageId: {{ custom_image.image_id | to_json }}
{% endif %}
aws:
type: {{ worker_instance_type | to_json }}
rootVolume:
type: {{ worker_storage_type | to_json }}
size: {{ worker_storage_size | int }}
{% if openshift_machineset_aws_zones | default([]) | length > 0 %}
zones: {{ openshift_machineset_aws_zones | unique | to_json }}
{% elif hostvars.localhost.openshift_machineset_aws_zones_odcr | default([]) | length > 0 %}
zones: {{ hostvars.localhost.openshift_machineset_aws_zones_odcr | unique | to_json }}
{% endif %}
{% endif %}
{% if cloud_provider == 'azure' %}
azure:
type: {{ worker_instance_type | to_json }}
{% endif %}
{% if cloud_provider == 'gcp' %}
gcp:
type: {{ worker_instance_type | to_json }}
{% endif %}
{% if cloud_provider == 'osp' %}
openstack:
type: {{ worker_instance_type | to_json }}
{% if worker_storage_type is defined and worker_storage_size is defined %}
rootVolume:
type: {{ worker_storage_type | to_json }}
size: {{ worker_storage_size | to_json }}
{% endif %}
{% endif %}
{% if cloud_provider == 'vmc' and worker_instance_cpu is defined and worker_instance_memory_mb is defined %}
vsphere:
cpus: {{ worker_instance_cpu | to_json }}
memoryMB: {{ worker_instance_memory_mb | to_json }}
{% endif %}
replicas: {{ worker_instance_count | int }}
networking:
clusterNetwork:
- cidr: {{ ocp_cluster_cidr | default('10.128.0.0/14') }}
hostPrefix: 23
machineCIDR: {{ ocp4_machine_cidr | default('10.0.0.0/16') | to_json }}
serviceNetwork:
- {{ ocp_service_network | default('172.30.0.0/16') }}
{% if ocp4_network_type | default("OVNKubernetes") is match("OpenshiftSDN") %}
networkType: OpenshiftSDN
{% elif ocp4_network_type | default("OVNKubernetes") is match("Calico") %}
networkType: Calico
{% else %}
networkType: OVNKubernetes
{% endif %}
platform:
{% if cloud_provider == 'ec2' %}
aws:
region: {{ aws_region_final | default(aws_region) | to_json }}
userTags: {{ hostvars.localhost.cloud_tags_final | default({}) | to_json }}
{% endif %}
{% if cloud_provider == 'azure' %}
azure:
region: {{ azure_region | to_json }}
baseDomainResourceGroupName: {{ az_dnszone_resource_group | to_json }}
userTags: {{ hostvars.localhost.cloud_tags_final | default({}) | to_json }}
{% endif %}
{% if cloud_provider == 'gcp' %}
gcp:
region: {{ gcp_region | to_json }}
ProjectID: {{ gcp_project_id | to_json }}
{% endif %}
{% if cloud_provider == 'vmc' %}
vsphere:
apiVIP: "{{ hostvars.localhost.project_segment_cidr | ansible.utils.nthhost(201) }}"
cluster: "{{ vcenter_cluster }}"
datacenter: "{{ vcenter_datacenter }}"
defaultDatastore: "{{ vcenter_datastore }}"
ingressVIP: "{{ hostvars.localhost.project_segment_cidr | ansible.utils.nthhost(202) }}"
network: "{{ hostvars.localhost.project_segment_name }}"
password: "{{ vcenter_password }}"
username: "{{ vcenter_username }}"
vCenter: "{{ vcenter_hostname }}"
folder: "/{{ vcenter_datacenter}}/vm/Workloads/{{ env_type }}-{{ guid }}/"
{% endif %}
{% if cloud_provider == 'osp' %}
openstack:
cloud: {{ osp_cloud_name | to_json }}
{% if ocp_use_single_network | bool %}
machinesSubnet: "{{ internal_network_subnet_id }}"
{% endif %}
computeFlavor: {{ worker_instance_type | to_json }}
{% if not ocp4_ansible_managed_osp_external_network | bool %}
externalNetwork: {{ provider_network | default('external') | to_json }}
lbFloatingIP: {{ hostvars.localhost.ocp_api_fip | to_json }}
{% if ocp4_installer_version is version_compare('4.6.0', '>=') %}
ingressFloatingIP: {{ hostvars.localhost.ocp_ingress_fip | to_json }}
{% endif %}
{% endif %}
{% if ocp4_installer_version is version_compare('4.6.0', '<') %}
octaviaSupport: {{ osp_octavia_support | default(true) | bool | to_json }}
region: ""
trunkSupport: {{ osp_trunk_support | default(true) | bool | to_json }}
{% endif %}
{% if rhcos_image_name is defined %}
clusterOSImage: {{ rhcos_image_name | to_json }}
{% endif %}
{% endif %}
{# ocp4_pull_secret may be either a dict (mapping) or a JSON string. #}
{# The install-config.yaml needs an quoted JSON string for the pullSecret. #}
{# Passing a json string through to_json gives us the quoted string. #}
{# To get to the quoted JSON string from a mapping we call to_json twice. #}
pullSecret: {{ ocp4_pull_secret | to_json | to_json if ocp4_pull_secret is mapping else ocp4_pull_secret | to_json }}
sshKey: {{ idrsapub.content | b64decode | to_json }}