Skip to content

Commit

Permalink
Updates to onprem OCP deployment
Browse files Browse the repository at this point in the history
- 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

- no need to patch the cluster network settings after boot
All the same settings are defined at cluster creation
  • Loading branch information
radez committed Dec 5, 2024
1 parent b90e362 commit ca80717
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
26 changes: 25 additions & 1 deletion ansible/roles/create-ai-cluster/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,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

Expand Down Expand Up @@ -90,6 +93,27 @@
set_fact:
ai_infraenv_id: "{{ create_infra_env_return.json.id }}"

# curl -X PATCH -H 'Content-Type: application/json;' -d '{"ignition_config_override": "{\"ignition\":{\"version\":\"3.1.0\"},\"storage\":{\"files\":[{\"contents\":{\"source\":\"data:text/plain;base64,bmV0LmlwdjQubmVpZ2guZGVmYXVsdC5nY190aHJlc2gxID0gMTAyNApuZXQuaXB2NC5uZWlnaC5kZWZhdWx0LmdjX3RocmVzaDIgPSA0MDk2Cm5ldC5pcHY0Lm5laWdoLmRlZmF1bHQuZ2NfdGhyZXNoMyA9IDgxOTIK\"},\"mode\":420,\"overwrite\":true,\"path\":\"/etc/sysctl.d/arp.conf\"}]}}"}' http://f04-h08-000-r640.rdu2.scalelab.redhat.com:8090/api/assisted-install/v2/infra-envs/faa5f20f-4a7d-4d92-90e8-25603a561e4a
- name: Patch infra-env for arp cache with ignition config overrides
uri:
url: "http://{{ assisted_installer_host }}:{{ assisted_installer_port }}/api/assisted-install/v2/infra-envs/{{ ai_infraenv_id }}"
method: PATCH
body_format: json
status_code: [201]
return_content: true
body: {
"ignition_config_override": "{{ lookup('template', 'arp.ign.j2') | to_json }}",
}
when: false

- name: Display all variables/facts known for a host
ansible.builtin.debug:
var: ai_infraenv_id

- name: Pause until you can verify updates to an application were successful
ansible.builtin.pause:


- name: Patch infra-env for bastion registry with ignition config overrides
uri:
url: "http://{{ assisted_installer_host }}:{{ assisted_installer_port }}/api/assisted-install/v2/infra-envs/{{ ai_infraenv_id }}"
Expand Down
15 changes: 15 additions & 0 deletions ansible/roles/hv-vm-create/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@
shell: |
virsh define {{ hv_kvm_def_path }}/{{ inventory_hostname }}.xml
- name: set arp proxy entries
shell: |
/usr/sbin/ip neighbour add {{ hostvars[inventory_hostname]['ip'] }} lladdr {{ hostvars[inventory_hostname]['mac_address'] }} nud permanent dev ens1f0
when: false

- name: flush arp nup entries
shell: /usr/sbin/ip neighbour flush nud permanent


- name: set arp proxy entries
shell: |
/usr/sbin/ip neighbour add {{ hostvars[inventory_hostname]['ip'] }} lladdr {{ hostvars[inventory_hostname]['mac_address'] }} nud permanent dev br0
#/usr/sbin/arp -i ens1f0 -sD {{ hostvars[inventory_hostname]['ip'] }} ens1f0 pub
- name: Set bmc url ipv4
set_fact:
bmc_url: "http://{{ hostvars[inventory_hostname]['hv_ip'] }}:{{ hv_bmc_port }}/redfish/v1/Systems/{{ hostvars[inventory_hostname]['domain_uuid'] }}"
Expand Down
38 changes: 0 additions & 38 deletions ansible/roles/wait-hosts-discovered/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down

0 comments on commit ca80717

Please sign in to comment.