Skip to content

Commit e53622f

Browse files
rlobilloopenshift-merge-bot[bot]
authored andcommitted
[shiftstack]Enable the option to run the role isolated
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.
1 parent 843c6f0 commit e53622f

File tree

5 files changed

+13
-1
lines changed

5 files changed

+13
-1
lines changed

roles/shiftstack/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Role for triggering Openshift on Openstack QA automation (installation and tests
1313
* `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`.
1414
* `cifmw_shiftstack_client_pvc_manifest`: (*string*) The file name for the shiftstackclient pvc manifest. Defaults to `"{{ cifmw_shiftstack_client_pod_name }}_pvc.yml"`.
1515
* `cifmw_shiftstack_cluster_name`: (*string*) The Openshift cluster name. Defaults to `ostest`.
16+
* `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.
1617
* `cifmw_shiftstack_installation_dir`: (*string*) Directory to place installation files. Defaults to `"{{ cifmw_shiftstack_shiftstackclient_artifacts_dir }}/installation"`.
1718
* `cifmw_shiftstack_manifests_dir`: (*string*) Directory name for the role generated Openshift manifests. Defaults to `"{{ cifmw_shiftstack_basedir }}/manifests"`.
1819
* `cifmw_shiftstack_project_name`: (*string*) The Openstack project name. Defaults to `shiftstack`.

roles/shiftstack/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ cifmw_shiftstack_client_pod_name: "shiftstackclient-{{ cifmw_shiftstack_project_
2828
cifmw_shiftstack_client_pod_namespace: "openstack"
2929
cifmw_shiftstack_client_pvc_manifest: "{{ cifmw_shiftstack_client_pod_name }}_pvc.yml"
3030
cifmw_shiftstack_cluster_name: "ostest"
31+
cifmw_shiftstack_exclude_artifacts_regex: "openshift-install"
3132
cifmw_shiftstack_installation_dir: "{{ cifmw_shiftstack_basedir }}/installation"
3233
cifmw_shiftstack_manifests_dir: "{{ cifmw_shiftstack_basedir }}/manifests"
3334
cifmw_shiftstack_project_name: "shiftstack"

roles/shiftstack/molecule/default/converge.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
cifmw_path: "{{ ansible_user_dir }}/.crc/bin:{{ ansible_user_dir }}/.crc/bin/oc:{{ ansible_user_dir }}/bin:{{ ansible_env.PATH }}"
2323
cifmw_openshift_kubeconfig: "{{ ansible_user_dir }}/.crc/machines/crc/kubeconfig"
2424
cifmw_shiftstack_run_playbook: cifmw-gate.yaml
25+
cifmw_shiftstack_exclude_artifacts_regex: ''
2526
cifmw_run_test_shiftstack_testconfig:
2627
- cifmw-gate.yaml
2728
- cifmw-gate.yaml # The purpose of this repeated test config is to check the test config loop logic

roles/shiftstack/tasks/pre_test_shiftstack.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
- name: Remove the shiftstackclient pod if exists
2323
kubernetes.core.k8s:
24+
kubeconfig: "{{ cifmw_openshift_kubeconfig }}"
2425
state: absent
2526
api_version: v1
2627
kind: Pod

roles/shiftstack/tasks/test_config.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
namespace: "{{ cifmw_shiftstack_client_pod_namespace }}"
3232
pod_name: "{{ cifmw_shiftstack_client_pod_name }}"
3333
command: >-
34+
source .bashrc &&
3435
cd shiftstack-qa &&
3536
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 }}
3637
ansible.builtin.include_tasks: exec_command_in_pod.yml
@@ -48,12 +49,19 @@
4849

4950
always:
5051
- name: "Copy the artifacts from the pod '{{ cifmw_shiftstack_client_pod_name }}'"
52+
vars:
53+
_exclude_options: >-
54+
{{
55+
'--exclude=' ~ cifmw_shiftstack_exclude_artifacts_regex
56+
if cifmw_shiftstack_exclude_artifacts_regex | default('') != ''
57+
else ''
58+
}}
5159
environment:
5260
PATH: "{{ cifmw_path }}"
5361
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
5462
ansible.builtin.command:
5563
cmd: >
56-
oc rsync -n {{ cifmw_shiftstack_client_pod_namespace }}
64+
oc rsync -n {{ cifmw_shiftstack_client_pod_namespace }} {{ _exclude_options }}
5765
{{ cifmw_shiftstack_client_pod_name }}:{{ cifmw_shiftstack_shiftstackclient_artifacts_dir }}/
5866
{{ testconfig_artifacts_dir }}/
5967
failed_when: false

0 commit comments

Comments
 (0)