Skip to content

Commit ea8dfd1

Browse files
committed
Add cifmw_project_dir and cifmw_project_dir_absolute vars
This commit is one of the steps of replacing common used vars with group_vars to improve overall maintenance of variables in ci-framework Signed-off-by: Amartya Sinha <[email protected]>
1 parent 1f658d8 commit ea8dfd1

File tree

12 files changed

+16
-13
lines changed

12 files changed

+16
-13
lines changed

group_vars/all.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22
# This file contains all repeating variables, that can be set
33
# globaly instead of parse Zuul inventory file to get proper value.
44
#### GLOBAL VARS ####
5+
ansible_user_dir: "{{ lookup('env', 'HOME') }}"
6+
cifmw_project_dir: src/github.com/openstack-k8s-operators/ci-framework
7+
cifmw_project_dir_absolute: "{{ ansible_user_dir }}/{{ cifmw_project_dir }}"

roles/build_containers/molecule/default/converge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
hosts: all
2020
vars:
2121
cifmw_build_containers_cleanup: true
22-
cifmw_build_containers_config_file: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/ci-framework/roles/build_containers/files/containers.yaml"
22+
cifmw_build_containers_config_file: "{{ cifmw_project_dir_absolute }}/roles/build_containers/files/containers.yaml"
2323
roles:
2424
- role: "build_containers"

roles/build_openstack_packages/molecule/default/converge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
hosts: all
2020
vars:
2121
ansible_user_dir: "{{ lookup('env', 'HOME') }}"
22-
cifmw_basedir: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/ci-framework"
22+
cifmw_basedir: "{{ cifmw_project_dir_absolute }}"
2323
cifmw_bop_openstack_release: master
2424
cifmw_bop_dlrn_baseurl: https://trunk.rdoproject.org/centos9-master
2525
cifmw_bop_yum_repos_dir: "{{ cifmw_basedir }}/artifacts/repositories/"

roles/build_openstack_packages/molecule/default/prepare.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
hosts: all
2020
vars:
2121
ansible_user_dir: "{{ lookup('env', 'HOME') }}"
22-
cifmw_basedir: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/ci-framework"
22+
cifmw_basedir: "{{ cifmw_project_dir_absolute }}"
2323
roles:
2424
- role: test_deps
2525
- role: repo_setup

roles/build_push_container/molecule/default/converge.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
cifmw_build_push_container_patch_number: 123
3333
cifmw_build_push_container_name: test_container_multi_arch
3434
cifmw_build_push_container_containerfile_path: >-
35-
{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/ci-framework/roles/build_push_container/molecule/default/files/containerfile
35+
"{{ cifmw_project_dir_absolute }}/roles/build_push_container/molecule/default/files/containerfile"
3636
cifmw_build_push_container_registry_name: 127.0.0.1:5001/cifmw-client/test_container_multi_arch
3737
cifmw_build_push_container_registry_tls_verify: false
3838
cifmw_build_push_container_supported_platform: [linux/amd64, linux/arm64]
@@ -78,7 +78,7 @@
7878
cifmw_build_push_container_patch_number: 123
7979
cifmw_build_push_container_name: test_container_single_arch
8080
cifmw_build_push_container_containerfile_path: >-
81-
{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/ci-framework/roles/build_push_container/molecule/default/files/containerfile
81+
"{{ cifmw_project_dir_absolute }}/roles/build_push_container/molecule/default/files/containerfile"
8282
cifmw_build_push_container_registry_name: 127.0.0.1:5001/cifmw-client/test_container_single_arch
8383
cifmw_build_push_container_registry_tls_verify: false
8484
ansible.builtin.include_role:

roles/ci_dcn_site/defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
ci_dcn_site_arch_repo_path: "{{ cifmw_architecture_repo | default('/home/zuul/src/github.com/openstack-k8s-operators/architecture') }}"
1818
ci_dcn_site_arch_path: "{{ ci_dcn_site_arch_repo_path }}/examples/dt/dcn"
19-
ci_dcn_site_cifmw_repo_path: /home/zuul/src/github.com/openstack-k8s-operators/ci-framework
19+
ci_dcn_site_cifmw_repo_path: "{{ cifmw_project_dir_absolute }}"
2020
ci_dcn_site_search_storage_network_names:
2121
- "storage"
2222
- "storagedcn1"

roles/copy_container/molecule/default/converge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
--config /tmp/copy-quay-config.yaml
5353
--release antelopecentos9 copy
5454
args:
55-
chdir: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/ci-framework/roles/copy_container/files/copy-quay"
55+
chdir: "{{ cifmw_project_dir_absolute }}/roles/copy_container/files/copy-quay"
5656

5757
- name: Curl local registry
5858
ansible.builtin.uri:

roles/dlrn_promote/molecule/check_criteria/converge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
- periodic-podified-edpm-baremetal-antelope-ocp-crc
2222
- periodic-podified-edpm-deployment-antelope-ocp-crc-1cs9
2323
- periodic-data-plane-adoption-github-rdo-centos-9-crc-single-node-antelope
24-
cifmw_dlrn_promote_criteria_file: '~/src/github.com/openstack-k8s-operators/ci-framework/roles/dlrn_promote/files/centos9_antelope.yaml'
24+
cifmw_dlrn_promote_criteria_file: '{{ cifmw_project_dir_absolute }}/roles/dlrn_promote/files/centos9_antelope.yaml'
2525
cifmw_dlrn_promote_promotion_target: current-podified
2626
tasks:
2727
- name: Check check_promotion_criteria playbook

roles/reproducer/molecule/crc_layout/converge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
mtu: 1500
3838
cifmw_use_libvirt: true
3939
cifmw_reproducer_repositories:
40-
- src: "{{ lookup('env', 'HOME') }}/src/github.com/openstack-k8s-operators/ci-framework"
40+
- src: "{{ cifmw_project_dir_absolute }}"
4141
dest: "/home/zuul/src/github.com/openstack-k8s-operators/"
4242
cifmw_libvirt_manager_configuration:
4343
vms:

roles/reproducer/tasks/configure_controller.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@
374374
- name: Check if local common-requirements.txt exists
375375
delegate_to: localhost
376376
ansible.builtin.stat:
377-
path: "{{ cifmw_reproducer_src_dir }}/github.com/openstack-k8s-operators/ci-framework/common-requirements.txt"
377+
path: "{{ cifmw_project_dir_absolute }}/common-requirements.txt"
378378
register: _local_common_requirements_check
379379
run_once: true
380380
ignore_errors: true
@@ -387,7 +387,7 @@
387387
requirements: "{{ have_local | ternary(local, remote) }}"
388388
vars:
389389
have_local: "{{ _local_common_requirements_check.stat is defined and _local_common_requirements_check.stat.exists }}"
390-
local: "{{ cifmw_reproducer_src_dir }}/github.com/openstack-k8s-operators/ci-framework/common-requirements.txt"
390+
local: "{{ cifmw_project_dir_absolute }}/common-requirements.txt"
391391
remote: https://raw.githubusercontent.com/openstack-k8s-operators/ci-framework/main/common-requirements.txt
392392

393393
- name: Inject most of the cifmw_ parameters passed to the reproducer run

0 commit comments

Comments
 (0)