From 59a378a946c9bceaec912a094bdf765e4c034c4d Mon Sep 17 00:00:00 2001 From: Dan Radez Date: Tue, 19 Nov 2024 10:54:48 -0500 Subject: [PATCH] Updates to onprem OCP deployment - Specify Podman as the deploy type for the bastion AI container example podman configmap: https://github.com/openshift/assisted-service/blob/master/deploy/podman/configmap.yml - configure cluster networking before workers are booted --- .../templates/onprem-environment.j2 | 1 + .../roles/create-ai-cluster/tasks/main.yml | 28 +++++++++++++- .../wait-hosts-discovered/tasks/main.yml | 38 ------------------- 3 files changed, 28 insertions(+), 39 deletions(-) diff --git a/ansible/roles/bastion-assisted-installer/templates/onprem-environment.j2 b/ansible/roles/bastion-assisted-installer/templates/onprem-environment.j2 index 00898ca7..33f08028 100644 --- a/ansible/roles/bastion-assisted-installer/templates/onprem-environment.j2 +++ b/ansible/roles/bastion-assisted-installer/templates/onprem-environment.j2 @@ -12,6 +12,7 @@ ASSISTED_SERVICE_HOST={{ assisted_installer_host }}:{{ assisted_installer_port } IMAGE_SERVICE_BASE_URL=http://{{ assisted_installer_host }}:{{ assisted_image_service_port }} LISTEN_PORT={{ assisted_image_service_port }} DEPLOY_TARGET=onprem +DEPLOY_TYPE="Podman" STORAGE=filesystem DUMMY_IGNITION=false diff --git a/ansible/roles/create-ai-cluster/tasks/main.yml b/ansible/roles/create-ai-cluster/tasks/main.yml index e13d5463..4c0f9776 100644 --- a/ansible/roles/create-ai-cluster/tasks/main.yml +++ b/ansible/roles/create-ai-cluster/tasks/main.yml @@ -52,7 +52,10 @@ "pull_secret": "{{ pull_secret | to_json }}", "ssh_public_key": "{{ lookup('file', ssh_public_key_file) }}", "vip_dhcp_allocation": "{{ vip_dhcp_allocation }}", - "additional_ntp_source": "{{ bastion_controlplane_ip if use_bastion_registry else labs[lab]['ntp_server'] }}" + "additional_ntp_source": "{{ bastion_controlplane_ip if use_bastion_registry else labs[lab]['ntp_server'] }}", + "api_vips":[{"ip": "{{ controlplane_network_api }}"}], + "ingress_vips": [{"ip": "{{ controlplane_network_ingress }}"}], + "network_type": "{{ networktype }}" } register: create_cluster_return @@ -135,3 +138,26 @@ - file_name: 99-disconnected-dns-workaround.yml template_name: 99-disconnected-dns-workaround.yml enabled: "{{ use_bastion_registry }}" + +- name: Patch cluster network settings + uri: + url: "http://{{ assisted_installer_host }}:{{ assisted_installer_port }}/api/assisted-install/v2/clusters/{{ ai_cluster_id }}" + method: PATCH + status_code: [201] + return_content: true + body_format: json + body: { + "cluster_networks": [ + { + "cidr": "{{ cluster_network_cidr }}", + "cluster_id": "{{ ai_cluster_id }}", + "host_prefix": "{{ cluster_network_host_prefix }}" + } + ], + "service_networks": [ + { + "cidr": "{{ service_network_cidr }}", + "cluster_id": "{{ ai_cluster_id }}", + } + ] + } diff --git a/ansible/roles/wait-hosts-discovered/tasks/main.yml b/ansible/roles/wait-hosts-discovered/tasks/main.yml index 12530ddc..053d8d47 100644 --- a/ansible/roles/wait-hosts-discovered/tasks/main.yml +++ b/ansible/roles/wait-hosts-discovered/tasks/main.yml @@ -55,44 +55,6 @@ loop_control: loop_var: discovered_host -- name: Patch cluster network settings - uri: - url: "http://{{ assisted_installer_host }}:{{ assisted_installer_port }}/api/assisted-install/v2/clusters/{{ ai_cluster_id }}" - method: PATCH - status_code: [201] - return_content: true - body_format: json - body: { - "cluster_networks": [ - { - "cidr": "{{ cluster_network_cidr }}", - "cluster_id": "{{ ai_cluster_id }}", - "host_prefix": "{{ cluster_network_host_prefix }}" - } - ], - "service_networks": [ - { - "cidr": "{{ service_network_cidr }}", - "cluster_id": "{{ ai_cluster_id }}", - } - ] - } - -- name: Patch cluster ingress/api vip addresses - uri: - url: "http://{{ assisted_installer_host }}:{{ assisted_installer_port }}/api/assisted-install/v2/clusters/{{ ai_cluster_id }}" - method: PATCH - status_code: [201] - return_content: true - body_format: json - body: { - "cluster_network_host_prefix": "{{ cluster_network_host_prefix }}", - "vip_dhcp_allocation": "{{ vip_dhcp_allocation }}", - "ingress_vips": [{"ip": "{{ controlplane_network_ingress }}"}], - "api_vips": [{"ip": "{{ controlplane_network_api }}"}], - "network_type": "{{ networktype }}" - } - - name: Wait for cluster to be ready uri: url: "http://{{ assisted_installer_host }}:{{ assisted_installer_port }}/api/assisted-install/v2/clusters/{{ ai_cluster_id }}"