From 734139bea226be182af28e83f6eda6a39d0b9037 Mon Sep 17 00:00:00 2001 From: Jon Uriarte Date: Fri, 27 Dec 2024 17:23:20 +0100 Subject: [PATCH] Add hypervisor param to shiftstack playbook execution For being able to resolve shift-on-stack apps endpoints (routes) hostnames from RHOSO pods it's required to add the DNS record entry in then dnsmasq service running on the hypervisor. It needs to be done after shift-on-stack cluster is installed as the installer is creating the floating IP for the apps endpoints, and the FIP is not known in advance. For that purpose the cifmw_shiftstack_hypervisor param is passed so the playbook running on the shiftstackclient pod is able to reach the hypervisor. This commit also adds the cifmw_shiftstack_shiftstackclient_incluster_kubeconfig_dir param to the shiftstack-qa playbook execution so it's able to find the RHOSO kubeconfig location. --- roles/shiftstack/README.md | 1 + roles/shiftstack/defaults/main.yml | 1 + roles/shiftstack/tasks/test_config.yml | 7 ++++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/roles/shiftstack/README.md b/roles/shiftstack/README.md index d15e94a4f6..88fa0bbe7c 100644 --- a/roles/shiftstack/README.md +++ b/roles/shiftstack/README.md @@ -13,6 +13,7 @@ Role for triggering Openshift on Openstack QA automation (installation and tests * `cifmw_shiftstack_client_pod_image`: (*string*) The image for the container running in the `cifmw_shiftstack_client_pod_name` pod. Defaults to `quay.io/shiftstack-qe/shiftstack-client:latest`. * `cifmw_shiftstack_client_pvc_manifest`: (*string*) The file name for the shiftstackclient pvc manifest. Defaults to `"{{ cifmw_shiftstack_client_pod_name }}_pvc.yml"`. * `cifmw_shiftstack_cluster_name`: (*string*) The Openshift cluster name. Defaults to `ostest`. +* `cifmw_shiftstack_hypervisor`: (*string*) The hypervisor where RHOSO is deployed. Defaults to `"{{ hostvars[hostvars['controller-0']['cifmw_hypervisor_host'] | default ('')]['ansible_host'] | default('') }}"`. * `cifmw_shiftstack_exclude_artifacts_regex`: (*string*) Regex that will be passed on `oc rsync` command as `--exclude` param, so the role does not gather the artifacts matching it. * `cifmw_shiftstack_installation_dir`: (*string*) Directory to place installation files. Defaults to `"{{ cifmw_shiftstack_shiftstackclient_artifacts_dir }}/installation"`. * `cifmw_shiftstack_manifests_dir`: (*string*) Directory name for the role generated Openshift manifests. Defaults to `"{{ cifmw_shiftstack_basedir }}/manifests"`. diff --git a/roles/shiftstack/defaults/main.yml b/roles/shiftstack/defaults/main.yml index 18a170a0fd..1fc9401d18 100644 --- a/roles/shiftstack/defaults/main.yml +++ b/roles/shiftstack/defaults/main.yml @@ -29,6 +29,7 @@ cifmw_shiftstack_client_pod_namespace: "openstack" cifmw_shiftstack_client_pvc_manifest: "{{ cifmw_shiftstack_client_pod_name }}_pvc.yml" cifmw_shiftstack_cluster_name: "ostest" cifmw_shiftstack_exclude_artifacts_regex: "openshift-install" +cifmw_shiftstack_hypervisor: "{{ hostvars[hostvars['controller-0']['cifmw_hypervisor_host'] | default ('')]['ansible_host'] | default('') }}" cifmw_shiftstack_installation_dir: "{{ cifmw_shiftstack_basedir }}/installation" cifmw_shiftstack_manifests_dir: "{{ cifmw_shiftstack_basedir }}/manifests" cifmw_shiftstack_project_name: "shiftstack" diff --git a/roles/shiftstack/tasks/test_config.yml b/roles/shiftstack/tasks/test_config.yml index 861b85b195..02e7cf746a 100644 --- a/roles/shiftstack/tasks/test_config.yml +++ b/roles/shiftstack/tasks/test_config.yml @@ -33,7 +33,12 @@ command: >- source .bashrc && cd shiftstack-qa && - ansible-navigator run playbooks/{{ cifmw_shiftstack_run_playbook }} -e @jobs_definitions/{{ testconfig }} -e ocp_cluster_name={{ cifmw_shiftstack_cluster_name }} -e user_cloud={{ cifmw_shiftstack_project_name }} + ansible-navigator run playbooks/{{ cifmw_shiftstack_run_playbook }} + -e @jobs_definitions/{{ testconfig }} + -e ocp_cluster_name={{ cifmw_shiftstack_cluster_name }} + -e user_cloud={{ cifmw_shiftstack_project_name }} + -e hypervisor={{ cifmw_shiftstack_hypervisor }} + -e rhoso_kubeconfig={{ cifmw_shiftstack_shiftstackclient_incluster_kubeconfig_dir }} ansible.builtin.include_tasks: exec_command_in_pod.yml rescue: