Skip to content

Commit

Permalink
Fix: Updated hcp binary extraction procedure and enahancements (#333)
Browse files Browse the repository at this point in the history
- 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 <[email protected]>
  • Loading branch information
veera-damisetti authored Oct 8, 2024
1 parent f4db0be commit 33a96df
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
1 change: 0 additions & 1 deletion docs/set-variables-group-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion inventories/default/group_vars/hcp.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ hcp:
ip:
protocol: http
iso_mount_dir:
os_variant:
disk:
network_name: macvtap
networking_device: enc1100 # Device for macvtap network
Expand Down
4 changes: 2 additions & 2 deletions roles/create_bastion_hcp/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 \
Expand Down
14 changes: 6 additions & 8 deletions roles/create_hcp_InfraEnv/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 33a96df

Please sign in to comment.