Skip to content

Commit

Permalink
[OSASINFRA] Copy rhoso kubeconfig to the shiftstack client pod
Browse files Browse the repository at this point in the history
  • Loading branch information
itzikb-redhat committed Dec 10, 2024
1 parent 49034ad commit c004f84
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions roles/shiftstack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Role for triggering Openshift on Openstack QA automation (installation and tests
* `cifmw_shiftstack_project_name`: (*string*) The Openstack project name. Defaults to `shiftstack`.
* `cifmw_shiftstack_qa_gerrithub_change`: (*string*) The gerrithub change to fetch from the `cifmw_shiftstack_qa_repo` repository (i.e. 'refs/changes/29/1188429/50)'. Defaults to ''.
* `cifmw_shiftstack_qa_repo`: (*string*) The repository containing the Openshift on Openstack QA automation. Defaults to `https://review.gerrithub.io/shiftstack/shiftstack-qa`.
* `cifmw_shiftstack_rhoso_kubeconfig`: "(*string*) The location in the `cifmw_shiftstack_client_pod_name` where to save the underlying openshift kubeconfig. Defaults to `{{ cifmw_shiftstack_shiftstackclient_installation_dir }}/rhoso_kubeconfig`
* `cifmw_shiftstack_run_playbook`: (*string*) The playbook to be run from the `cifmw_shiftstack_qa_repo` repository. Defaults to `ocp_testing.yaml`.
* `cifmw_shiftstack_sc`: (*string*) The storage class to be used for PVC for the shiftstackclient pod. Defaults to `local-storage`.
* `cifmw_shiftstack_shiftstackclient_artifacts_dir`: (*string*) The artifacts directory path for the shiftstackclient pod. Defaults to `/home/cloud-admin/artifacts`.
Expand Down
1 change: 1 addition & 0 deletions roles/shiftstack/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ cifmw_shiftstack_manifests_dir: "{{ cifmw_shiftstack_basedir }}/manifests"
cifmw_shiftstack_project_name: "shiftstack"
cifmw_shiftstack_qa_gerrithub_change: ""
cifmw_shiftstack_qa_repo: "https://review.gerrithub.io/shiftstack/shiftstack-qa"
cifmw_shiftstack_rhoso_kubeconfig: "{{ cifmw_shiftstack_shiftstackclient_installation_dir }}/rhoso_kubeconfig"
cifmw_shiftstack_run_playbook: "ocp_testing.yaml"
cifmw_shiftstack_sc: "local-storage"
cifmw_shiftstack_shiftstackclient_artifacts_dir: "/home/cloud-admin/artifacts"
Expand Down
3 changes: 3 additions & 0 deletions roles/shiftstack/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
- name: Deploy the pod '{{ cifmw_shiftstack_client_pod_name }}'
ansible.builtin.include_tasks: deploy_shiftstackclient_pod.yml

- name: Run post shiftstack client pod actions
ansible.builtin.include_tasks: post_deploy_shiftstackclient_pod.yml

- name: Test Openshift on Openstack
ansible.builtin.include_tasks: test_shiftstack.yml

Expand Down
23 changes: 23 additions & 0 deletions roles/shiftstack/tasks/post_deploy_shiftstackclient_pod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
# Copyright Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

- name: "Copy the RHOSO's management kubeconfig to '{{ cifmw_shiftstack_client_pod_name }}'"
environment:
PATH: "{{ cifmw_path }}"
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
ansible.builtin.command:
cmd: >
oc cp {{ cifmw_openshift_kubeconfig }} {{ cifmw_shiftstack_client_pod_name}}:{{ cifmw_shiftstack_rhoso_kubeconfig }} -n {{ cifmw_shiftstack_client_pod_namespace }}

0 comments on commit c004f84

Please sign in to comment.