Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[shiftstack]Enable the option to run the role isolated #2572

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions roles/shiftstack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,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_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"`.
* `cifmw_shiftstack_project_name`: (*string*) The Openstack project name. Defaults to `shiftstack`.
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 @@ -26,6 +26,7 @@ cifmw_shiftstack_client_pod_name: "shiftstackclient-{{ cifmw_shiftstack_project_
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_installation_dir: "{{ cifmw_shiftstack_basedir }}/installation"
cifmw_shiftstack_manifests_dir: "{{ cifmw_shiftstack_basedir }}/manifests"
cifmw_shiftstack_project_name: "shiftstack"
Expand Down
1 change: 1 addition & 0 deletions roles/shiftstack/molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
cifmw_path: "{{ ansible_user_dir }}/.crc/bin:{{ ansible_user_dir }}/.crc/bin/oc:{{ ansible_user_dir }}/bin:{{ ansible_env.PATH }}"
cifmw_openshift_kubeconfig: "{{ ansible_user_dir }}/.crc/machines/crc/kubeconfig"
cifmw_shiftstack_run_playbook: cifmw-gate.yaml
cifmw_shiftstack_exclude_artifacts_regex: ''
cifmw_run_test_shiftstack_testconfig:
- cifmw-gate.yaml
- cifmw-gate.yaml # The purpose of this repeated test config is to check the test config loop logic
Expand Down
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
10 changes: 9 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 @@ -48,12 +49,19 @@

always:
- name: "Copy the artifacts from the pod '{{ cifmw_shiftstack_client_pod_name }}'"
vars:
_exclude_options: >-
{{
'--exclude=' ~ cifmw_shiftstack_exclude_artifacts_regex
if cifmw_shiftstack_exclude_artifacts_regex | default('') != ''
rlobillo marked this conversation as resolved.
Show resolved Hide resolved
else ''
}}
environment:
PATH: "{{ cifmw_path }}"
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_options }}
{{ cifmw_shiftstack_client_pod_name }}:{{ cifmw_shiftstack_shiftstackclient_artifacts_dir }}/
{{ testconfig_artifacts_dir }}/
failed_when: false
Loading