From 33a96dfac47688340726027da52927e39a9b2580 Mon Sep 17 00:00:00 2001 From: Veerabhadrarao Damisetti Date: Tue, 8 Oct 2024 19:13:24 +0530 Subject: [PATCH] Fix: Updated hcp binary extraction procedure and enahancements (#333) - Updated hcp binary extraction procedure - Removes os_variant variable in bastion creation, as it can fetch from installation media - Updated documentation Signed-off-by: DAMISETTI-VEERABHADRARAO --- docs/set-variables-group-vars.md | 1 - inventories/default/group_vars/hcp.yaml.template | 1 - roles/create_bastion_hcp/tasks/main.yaml | 4 ++-- roles/create_hcp_InfraEnv/tasks/main.yaml | 14 ++++++-------- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/docs/set-variables-group-vars.md b/docs/set-variables-group-vars.md index 004ae31e..490ceeb5 100644 --- a/docs/set-variables-group-vars.md +++ b/docs/set-variables-group-vars.md @@ -317,7 +317,6 @@ **hcp.bastion_params.file_server.ip** | IPv4 address for the file server that will be used to pass config files and iso to KVM host LPAR(s) and bastion VM during their first boot. | 192.168.10.201 **hcp.bastion_params.file_server.protocol** | Protocol used to serve the files, either 'ftp' or 'http' | http **hcp.bastion_params.file_server.iso_mount_dir** | Directory path relative to the HTTP/FTP accessible directory where RHEL ISO is mounted. For example, if the FTP root is at /home/user1 and the ISO is mounted at /home/user1/RHEL/8.7 then this variable would be RHEL/8.7 - no slash before or after. | RHEL/8.7 -**hcp.bastion_params.os_variant** | rhel os variant for creating bastion | 8.7 **hcp.bastion_params.disk** | rhel os variant for creating bastion | 8.7 **hcp.bastion_params.network_name** | rhel os variant for creating bastion | 8.7 **hcp.bastion_params.networking_device** | The network interface card from Linux's perspective. Usually enc and then a number that comes from the dev_num of the network adapter. | enc1100 diff --git a/inventories/default/group_vars/hcp.yaml.template b/inventories/default/group_vars/hcp.yaml.template index 1dc0ece9..3c47c2b2 100644 --- a/inventories/default/group_vars/hcp.yaml.template +++ b/inventories/default/group_vars/hcp.yaml.template @@ -55,7 +55,6 @@ hcp: ip: protocol: http iso_mount_dir: - os_variant: disk: network_name: macvtap networking_device: enc1100 # Device for macvtap network diff --git a/roles/create_bastion_hcp/tasks/main.yaml b/roles/create_bastion_hcp/tasks/main.yaml index d269ed18..3ed1b905 100644 --- a/roles/create_bastion_hcp/tasks/main.yaml +++ b/roles/create_bastion_hcp/tasks/main.yaml @@ -21,7 +21,7 @@ timezone: "{{ hcp.bastion_params.timezone }}" keyboard: "{{ hcp.bastion_params.keyboard }}" use_ipv6: False - install_config: + install_config_vars: control: architecture: "s390x" cluster: @@ -80,7 +80,7 @@ --memory 4096 \ --vcpus sockets=1,cores=4,threads=1 \ --disk $disk_param \ - --os-variant "rhel{{hcp.bastion_params.os_variant}}" \ + --osinfo detect=on,require=off \ --network network:{{ hcp.bastion_params.network_name }} \ --location '{{ env.file_server.protocol }}://{{ env.file_server.user + ':' + env.file_server.pass + '@' if env.file_server.protocol == 'ftp' else '' }}{{ env.file_server.ip }}{{ ':' + env.file_server.port if env.file_server.port | default('') | length > 0 else '' }}/{{ env.file_server.iso_mount_dir }}/' \ --rng=/dev/urandom --initrd-inject /home/libvirt/bastion.ks \ diff --git a/roles/create_hcp_InfraEnv/tasks/main.yaml b/roles/create_hcp_InfraEnv/tasks/main.yaml index fd85a6aa..934a4889 100644 --- a/roles/create_hcp_InfraEnv/tasks/main.yaml +++ b/roles/create_hcp_InfraEnv/tasks/main.yaml @@ -36,17 +36,15 @@ - app= hcp-cli-download register: hcp_pod_name -- name: Get hcp.tar.gz file from pod - kubernetes.core.k8s_cp: - namespace: "{{ hcp.asc.mce_namespace }}" - pod: "{{ hcp_pod_name.resources[0].metadata.name }}" - remote_path: "/opt/app-root/src/linux/s390x/" - local_path: "/root/ansible_workdir" - state: from_pod - - name: Get hcp.tar.gz file from pod ansible.builtin.shell: "oc cp multicluster-engine/{{ hcp_pod_name.resources[0].metadata.name }}:/opt/app-root/src/linux/s390x/ /root/ansible_workdir" +- name: Extract binary from hcp.tar.gz + unarchive: + src: /root/ansible_workdir/hcp.tar.gz + dest: /usr/local/bin/ + remote_src: true + - name: Get ICSP for Hosted Control Plane template: src: icsp.yaml.j2