|
4 | 4 | block: |
5 | 5 | - name: Download baremetalhosts manifest |
6 | 6 | get_url: |
7 | | - url: https://raw.githubusercontent.com/openshift/assisted-service/master/hack/crds/metal3.io_baremetalhosts.yaml |
| 7 | + url: https://raw.githubusercontent.com/openshift/assisted-service/refs/heads/master/hack/crds/metal3/metal3.io_baremetalhosts.yaml |
8 | 8 | dest: ./metal3.io_baremetalhosts.yaml |
9 | 9 | mode: 0664 |
10 | 10 |
|
|
15 | 15 |
|
16 | 16 | - name: Download preprovisioningimages manifest |
17 | 17 | get_url: |
18 | | - url: https://raw.githubusercontent.com/openshift/assisted-service/refs/heads/master/hack/crds/metal3.io_preprovisioningimages.yaml |
| 18 | + url: https://raw.githubusercontent.com/openshift/assisted-service/refs/heads/master/hack/crds/metal3/metal3.io_preprovisioningimages.yaml |
19 | 19 | dest: ./metal3.io_preprovisioningimages.yaml |
20 | 20 | mode: 0664 |
21 | 21 |
|
|
216 | 216 | src: "{{ role_path }}/templates/agent-service-config.yml" |
217 | 217 | when: ocp_release_version.stdout != "" and ocp_release_min.stdout != "" |
218 | 218 |
|
| 219 | +- name: Update AgentServiceConfig for heterogeneous |
| 220 | + block: |
| 221 | + - name: Update AgentServiceConfig |
| 222 | + template: |
| 223 | + src: "{{ role_path }}/templates/agent-service-config-heterogeneous.yaml.j2" |
| 224 | + dest: "{{ role_path }}/templates/agent-service-config-heterogeneous.yml" |
| 225 | + |
| 226 | + - name: Deploy AgentServiceConfig |
| 227 | + kubernetes.core.k8s: |
| 228 | + state: present |
| 229 | + src: "{{ role_path }}/templates/agent-service-config-heterogeneous.yml" |
| 230 | + when: ocp_release_version.stdout != "" and ocp_release_min.stdout != "" |
| 231 | + when: heterogeneous_install |
| 232 | + |
219 | 233 | - name: Hypershift deployment |
220 | 234 | block: |
221 | | - - name: Create namespace for hosted control plane namespace |
| 235 | + - name: Create namespace for hosted control plane |
222 | 236 | kubernetes.core.k8s: |
223 | 237 | state: present |
224 | 238 | definition: |
|
233 | 247 | finalizers: |
234 | 248 | - kubernetes |
235 | 249 |
|
| 250 | + - name: Set value for infra_availability_policy |
| 251 | + set_fact: |
| 252 | + infra_availability_policy: "{{ 'HighlyAvailable' if heterogeneous_install else 'SingleReplica' }}" |
| 253 | + cacheable: yes |
| 254 | + |
236 | 255 | - name: Create Hypershift Cluster Agent |
237 | 256 | shell: | |
238 | | - hcp create cluster agent --name={{ hosted_cluster_name }} --pull-secret={{ pull_secret_file }} --infra-availability-policy SingleReplica --control-plane-availability-policy=SingleReplica --agent-namespace={{ hosted_control_plane_namespace }} --ssh-key {{ ssh_pub_key_value.stdout }} --base-domain={{ base_domain }} --api-server-address=api.{{ hosted_cluster_name }}.{{ base_domain }} --release-image=quay.io/openshift-release-dev/ocp-release:{{ ocp_release }}-multi --render-sensitive --render > {{ hypershift_dir }}/render-{{ hosted_cluster_name }}.yaml |
| 257 | + hcp create cluster agent --name={{ hosted_cluster_name }} --pull-secret={{ pull_secret_file }} --infra-availability-policy {{ infra_availability_policy }} --control-plane-availability-policy=SingleReplica --agent-namespace={{ hosted_control_plane_namespace }} --ssh-key {{ ssh_pub_key }} --base-domain={{ base_domain }} --api-server-address=api.{{ hosted_cluster_name }}.{{ base_domain }} --release-image={{ ocp_release_image }} --render-sensitive --render --node-pool-replicas -1 > {{ hypershift_dir }}/render-{{ hosted_cluster_name }}.yaml |
239 | 258 | ignore_errors: true |
240 | 259 | environment: |
241 | 260 | PATH: "{{ hypershift_dir }}/bin:{{ ansible_env.PATH }}" |
|
285 | 304 | shell: "cat {{ ssh_pub_key }}" |
286 | 305 | register: ssh_pub_key_value |
287 | 306 |
|
288 | | -- name: Create InfraEnv |
| 307 | +- name: Create NodePool for ppc64le nodes |
| 308 | + template: |
| 309 | + src: "{{ role_path }}/templates/Nodepool-ppc.yaml.j2" |
| 310 | + dest: "{{ role_path }}/templates/Nodepool-ppc.yml" |
| 311 | + delegate_to: localhost |
| 312 | + |
| 313 | +- name: Deploy NodePool for ppc64le nodes |
| 314 | + kubernetes.core.k8s: |
| 315 | + state: present |
| 316 | + src: "{{ role_path }}/templates/Nodepool-ppc.yml" |
| 317 | + |
| 318 | +- name: Create InfraEnv for ppc64le |
289 | 319 | kubernetes.core.k8s: |
290 | 320 | state: present |
291 | 321 | definition: |
292 | 322 | apiVersion: agent-install.openshift.io/v1beta1 |
293 | 323 | kind: InfraEnv |
294 | 324 | metadata: |
295 | | - name: "{{ hosted_cluster_name }}" |
| 325 | + name: "{{ hosted_cluster_name }}-ppc" |
296 | 326 | namespace: "{{ hosted_control_plane_namespace }}" |
297 | 327 | spec: |
298 | | - cpuArchitecture: ppc64le |
| 328 | + cpuArchitecture: "{{ arch_ppc }}" |
299 | 329 | pullSecretRef: |
300 | 330 | name: pull-secret |
301 | 331 | sshAuthorizedKey: "{{ ssh_pub_key_value.stdout }}" |
302 | 332 |
|
| 333 | +- name: Create NodePool and InfraEnv for heterogeneous |
| 334 | + block: |
| 335 | + - name: Create NodePool for x86 nodes |
| 336 | + template: |
| 337 | + src: "{{ role_path }}/templates/Nodepool-x86.yaml.j2" |
| 338 | + dest: "{{ role_path }}/templates/Nodepool-x86.yml" |
| 339 | + |
| 340 | + - name: Deploy NodePool for x86 nodes |
| 341 | + kubernetes.core.k8s: |
| 342 | + state: present |
| 343 | + src: "{{ role_path }}/templates/Nodepool-x86.yml" |
| 344 | + |
| 345 | + - name: Create InfraEnv for x86 |
| 346 | + kubernetes.core.k8s: |
| 347 | + state: present |
| 348 | + definition: |
| 349 | + apiVersion: agent-install.openshift.io/v1beta1 |
| 350 | + kind: InfraEnv |
| 351 | + metadata: |
| 352 | + name: "{{ hosted_cluster_name }}-x86" |
| 353 | + namespace: "{{ hosted_control_plane_namespace }}" |
| 354 | + spec: |
| 355 | + cpuArchitecture: "{{ arch_x86 }}" |
| 356 | + pullSecretRef: |
| 357 | + name: pull-secret |
| 358 | + sshAuthorizedKey: "{{ ssh_pub_key_value.stdout }}" |
| 359 | + when: heterogeneous_install |
| 360 | + |
303 | 361 | - name: Check if the ISO is generated |
304 | 362 | shell: "oc get infraenv -n {{ hosted_control_plane_namespace }} --no-headers | awk '{ print $2 }'" |
305 | 363 | register: infraenv_iso |
306 | 364 | until: infraenv_iso.stdout|length > 0 |
307 | 365 | retries: 15 |
308 | 366 | delay: 60 |
309 | 367 |
|
310 | | -- name: Get the url of the generated ISO |
311 | | - shell: "oc get -n {{ hosted_control_plane_namespace }} InfraEnv {{ hosted_cluster_name }} -ojsonpath='{.status.isoDownloadURL}'" |
| 368 | +- name: Get the url of the generated power ISO |
| 369 | + shell: "oc get -n {{ hosted_control_plane_namespace }} InfraEnv {{ hosted_cluster_name }}-ppc -ojsonpath='{.status.isoDownloadURL}'" |
312 | 370 | register: infraenv_iso |
313 | 371 |
|
314 | | -- name: Output the ISO URL link for download |
| 372 | +- name: Output the power ISO URL link for download |
315 | 373 | debug: |
316 | 374 | msg: "{{ infraenv_iso.stdout }}" |
317 | 375 |
|
| 376 | +- name: Get the x86 ISO details |
| 377 | + block: |
| 378 | + - name: Get initrd_url |
| 379 | + shell: (oc get -n {{ hosted_control_plane_namespace }} InfraEnv {{ hosted_cluster_name }}-x86 -o json | jq -r '."status"."bootArtifacts"."initrd"') |
| 380 | + register: initrd_url |
| 381 | + |
| 382 | + - name: Get kernel_url |
| 383 | + shell: (oc get -n {{ hosted_control_plane_namespace }} InfraEnv {{ hosted_cluster_name }}-x86 -o json | jq -r '."status"."bootArtifacts"."kernel"') |
| 384 | + register: kernel_url |
| 385 | + |
| 386 | + - name: Get rootfs_url |
| 387 | + shell: (oc get -n {{ hosted_control_plane_namespace }} InfraEnv {{ hosted_cluster_name }}-x86 -o json | jq -r '."status"."bootArtifacts"."rootfs"') |
| 388 | + register: rootfs_url |
| 389 | + |
| 390 | + - name: Output values of initrd_url, kernel_url and rootfs_url |
| 391 | + debug: |
| 392 | + msg: |
| 393 | + - "initrd_url: {{ initrd_url.stdout }}" |
| 394 | + - "kernel_url: {{ kernel_url.stdout }}" |
| 395 | + - "rootfs_url: {{ rootfs_url.stdout }}" |
| 396 | + when: heterogeneous_install |
| 397 | + |
318 | 398 | - name: Output the Kubernetes api service to create DNS entries |
319 | 399 | debug: |
320 | | - msg: "{{ dns_entry.stdout }}" |
| 400 | + msg: "{{ dns_entry.stdout }}" |
321 | 401 |
|
322 | 402 | - name: Output the location of Kubeconfig of the hosted cluster |
323 | 403 | debug: |
|
0 commit comments