Skip to content

Commit

Permalink
[shiftstack]Enable the option to run the role isolated
Browse files Browse the repository at this point in the history
In order to allow users to run the shiftsatck role without being part of
the whole reproducer, below changes are needed:

- Add missing kubeconfig param
- Load .bashrc whle running the ansible-navigator. That's needed
for reading the envvars that will be used for writting the junit report.
- Enable the option to exclude artifacts to be gathered.
  • Loading branch information
rlobillo committed Nov 29, 2024
1 parent 794cc44 commit 3fd2d2e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions roles/shiftstack/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ cifmw_shiftstack_qa_repo: "https://review.gerrithub.io/shiftstack/shiftstack-qa"
cifmw_shiftstack_run_playbook: "ocp_testing.yaml"
cifmw_shiftstack_sc: "local-storage"
cifmw_shiftstack_shiftstackclient_artifacts_dir: "/home/cloud-admin/artifacts"
cifmw_shiftstack_exclude_artifacts_regex: "openshift-install"
cifmw_shiftstack_shiftstackclient_installation_dir: "{{ cifmw_shiftstack_shiftstackclient_artifacts_dir }}/installation"
1 change: 1 addition & 0 deletions roles/shiftstack/tasks/pre_test_shiftstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

- name: Remove the shiftstackclient pod if exists
kubernetes.core.k8s:
kubeconfig: "{{ cifmw_openshift_kubeconfig }}"
state: absent
api_version: v1
kind: Pod
Expand Down
3 changes: 2 additions & 1 deletion roles/shiftstack/tasks/test_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
namespace: "{{ cifmw_shiftstack_client_pod_namespace }}"
pod_name: "{{ cifmw_shiftstack_client_pod_name }}"
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.builtin.include_tasks: exec_command_in_pod.yml
Expand All @@ -53,7 +54,7 @@
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
ansible.builtin.command:
cmd: >
oc rsync -n {{ cifmw_shiftstack_client_pod_namespace }}
oc rsync -n {{ cifmw_shiftstack_client_pod_namespace }} --exclude={{ cifmw_shiftstack_exclude_artifacts_regex }}
{{ cifmw_shiftstack_client_pod_name }}:{{ cifmw_shiftstack_shiftstackclient_artifacts_dir }}/
{{ testconfig_artifacts_dir }}/
failed_when: false

0 comments on commit 3fd2d2e

Please sign in to comment.