Skip to content

Commit f66a47b

Browse files
committed
Move cifmw_installyamls_repos var to group_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 662c0ca commit f66a47b

File tree

24 files changed

+12
-25
lines changed

24 files changed

+12
-25
lines changed

docs/source/development/02_molecule.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ cifmw_internal_registry_login: false
7474
cifmw_basedir: "{{ ansible_user_dir }}/ci-framework-data"
7575
cifmw_openshift_setup_skip_internal_registry: true
7676
cifmw_artifacts_basedir: "{{ ansible_user_dir }}/ci-framework-data/artifacts "
77-
cifmw_installyamls_repos: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls"
7877
nodepool:
7978
cloud: ""
8079
mol_config_dir: /home/$(whoami)/src/github.com/openstack-k8s-operators/ci-framework/.config/molecule/config_local.yml

group_vars/all.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@
55
ansible_user_dir: "{{ lookup('env', 'HOME') }}"
66
cifmw_project_dir: src/github.com/openstack-k8s-operators/ci-framework
77
cifmw_project_dir_absolute: "{{ ansible_user_dir }}/{{ cifmw_project_dir }}"
8+
cifmw_installyamls_repos_relative: src/github.com/openstack-k8s-operators/install_yamls
9+
# since cifmw_installyamls_repos var already exists, let's use that and move all definition here in single place instead of creating another variable.
10+
cifmw_installyamls_repos: "{{ ansible_user_dir }}/{{ cifmw_installyamls_repos_relative }}"

plugins/modules/generate_make_tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
4343
- name: Generate make tasks
4444
generate_make_tasks:
45-
install_yamls_path: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls/"
45+
install_yamls_path: "{{ cifmw_installyamls_repos }}"
4646
output_directory: "{{ ansible_user_dir }}/make_installyamls/tasks"
4747
""" # noqa
4848

roles/edpm_deploy/molecule/default/prepare.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
vars:
2121
ansible_user_dir: "{{ lookup('env', 'HOME') }}"
2222
cifmw_install_yamls_tasks_out: "{{ ansible_user_dir }}/zuul-jobs/roles/install_yamls_makes/tasks"
23-
cifmw_installyamls_repos: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls"
2423
cifmw_install_yamls_defaults:
2524
NAMESPACE: openstack
2625
roles:

roles/edpm_deploy_baremetal/molecule/default/prepare.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
ansible_user_dir: "{{ lookup('env', 'HOME') }}"
2222
cifmw_basedir: "{{ ansible_user_dir }}/ci-framework-data"
2323
cifmw_install_yamls_tasks_out: "{{ ansible_user_dir }}/zuul-jobs/roles/install_yamls_makes/tasks"
24-
cifmw_installyamls_repos: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls"
2524
roles:
2625
- role: test_deps
2726
- role: ci_setup

roles/edpm_prepare/molecule/default/prepare.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
ansible_user_dir: "{{ lookup('env', 'HOME') }}"
2222
cifmw_basedir: "{{ ansible_user_dir }}/ci-framework-data"
2323
cifmw_install_yamls_tasks_out: "{{ ansible_user_dir }}/zuul-jobs/roles/install_yamls_makes/tasks"
24-
cifmw_installyamls_repos: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls"
2524
cifmw_install_yamls_defaults:
2625
NAMESPACE: openstack
2726
roles:

roles/install_yamls/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ It contains a set of playbooks to deploy podified control plane.
99
* `cifmw_install_yamls_envfile`: (String) Environment file containing all the Makefile overrides. Defaults to `install_yamls`.
1010
* `cifmw_install_yamls_out_dir`: (String) `install_yamls` output directory to store generated output. Defaults to `{{ cifmw_basedir | default(ansible_user_dir ~ '/ci-framework-data') }}/artifacts"`.
1111
* `cifmw_install_yamls_vars`: (Dict) A dict containing Makefile overrides.
12-
* `cifmw_install_yamls_repo`: (String) `install_yamls` repo path. Defaults to `{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls`.
12+
* `cifmw_install_yamls_repo`: (String) `install_yamls` repo path. Defaults to `{{ cifmw_installyamls_repos | default(ansible_user_dir ~ '/src/github.com/openstack-k8s-operators/install_yamls')}}`
1313
* `cifmw_install_yamls_whitelisted_vars`: (List) Allowed variables in `cifmw_install_yamls_vars` that are not part of `install_yamls` Makefiles.
1414
* `cifmw_install_yamls_edpm_dir`: (String) Output directory for EDPM related artifacts (OUTPUT_BASEDIR). Defaults to `{{ cifmw_install_yamls_out_dir_basedir ~ '/artifacts/edpm' }}`
1515
* `cifmw_install_yamls_checkout_openstack_ref`: (String) Enable the checkout from openstack-operator references
@@ -43,7 +43,7 @@ The created role directory contains multiple task files, similar to
4343
register: "make_crc_storage_status"
4444
cifmw.general.ci_script:
4545
output_dir: "{{ cifmw_basedir|default(ansible_user_dir ~ '/ci-framework-data') }}/artifacts"
46-
chdir: "/home/zuul/src/github.com/openstack-k8s-operators/install_yamls"
46+
chdir: "{{ cifmw_install_yamls_repo }}"
4747
script: make crc_storage
4848
dry_run: "{{ make_crc_storage_dryrun|default(false)|bool }}"
4949
extra_args: "{{ dict((make_crc_storage_env|default({})), **(make_crc_storage_params|default({}))) }}"
@@ -121,7 +121,7 @@ Let's look at below example:-
121121
register: "make_ansibleee_cleanup_status"
122122
cifmw.general.ci_script:
123123
output_dir: "{{ cifmw_basedir|default(ansible_user_dir ~ '/ci-framework-data') }}/artifacts"
124-
chdir: "/home/zuul/src/github.com/openstack-k8s-operators/install_yamls"
124+
chdir: "{{ cifmw_install_yamls_repo }}"
125125
script: "make ansibleee_cleanup"
126126
dry_run: "{{ make_ansibleee_cleanup_dryrun|default(false)|bool }}"
127127
extra_args: "{{ dict((make_ansibleee_cleanup_env|default({})), **(make_ansibleee_cleanup_params|default({}))) }}"

roles/install_yamls/molecule/default/converge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
namespace: foobar
2323
openstack_ctlplane: controlplane-yaml-file.yaml
2424
ansible_user_dir: "{{ lookup('env', 'HOME') }}"
25-
cifmw_install_yamls_repo: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls"
25+
cifmw_install_yamls_repo: "{{ cifmw_installyamls_repos }}"
2626
zuul:
2727
branch: main
2828
items:

roles/reproducer/molecule/crc_layout/converge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
- src: "/tmp/ipmi-things"
2727
dest: "/home/zuul/ipmi-things"
2828
cifmw_basedir: "/opt/basedir"
29-
cifmw_install_yamls_repo: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls"
29+
cifmw_install_yamls_repo: "{{ cifmw_installyamls_repos }}"
3030
cifmw_path: "{{ ansible_user_dir }}/.crc/bin:{{ ansible_user_dir }}/.crc/bin/oc:{{ ansible_user_dir }}/bin:{{ ansible_env.PATH }}"
3131
_networks:
3232
public:

roles/reproducer/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@
300300
_devsetup_path: >-
301301
{{
302302
(
303-
cifmw_install_yamls_repo | default('/home/zuul/src/github.com/openstack-k8s-operators/install_yamls'),
303+
cifmw_installyamls_repos,
304304
'devsetup'
305305
) | ansible.builtin.path_join
306306
}}

0 commit comments

Comments
 (0)