From b35c719ea0a2bcd461c9a4cb722bd462e0e7437c Mon Sep 17 00:00:00 2001 From: Amartya Sinha Date: Wed, 22 Oct 2025 15:25:59 +0530 Subject: [PATCH] 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 --- docs/source/development/02_molecule.md | 1 - group_vars/all.yml | 3 +++ plugins/modules/generate_make_tasks.py | 2 +- roles/edpm_deploy/molecule/default/prepare.yml | 1 - roles/edpm_deploy_baremetal/molecule/default/prepare.yml | 1 - roles/edpm_prepare/molecule/default/prepare.yml | 1 - roles/install_yamls/README.md | 6 +++--- roles/install_yamls/molecule/default/converge.yml | 2 +- roles/reproducer/molecule/crc_layout/converge.yml | 2 +- roles/reproducer/tasks/main.yml | 2 +- roles/reproducer/tasks/reuse_main.yaml | 2 +- roles/reproducer/vars/main.yml | 2 +- roles/tempest/molecule/default/prepare.yml | 1 - roles/tofu/molecule/default/prepare.yml | 1 - roles/update/molecule/default/prepare.yml | 1 - scenarios/centos-9/ci.yml | 1 - scenarios/centos-9/content_provider.yml | 1 - scenarios/centos-9/edpm_baremetal_deployment_ci.yml | 1 - scenarios/centos-9/edpm_ci.yml | 1 - scenarios/centos-9/install_yamls.yml | 1 - scenarios/centos-9/meta_content_provider.yml | 1 - scenarios/centos-9/podified_common.yml | 1 - scenarios/centos-9/tcib.yml | 1 - scenarios/reproducers/3-nodes.yml | 1 - 24 files changed, 12 insertions(+), 25 deletions(-) diff --git a/docs/source/development/02_molecule.md b/docs/source/development/02_molecule.md index e5efa2809d..7d94fa86dd 100644 --- a/docs/source/development/02_molecule.md +++ b/docs/source/development/02_molecule.md @@ -74,7 +74,6 @@ cifmw_internal_registry_login: false cifmw_basedir: "{{ ansible_user_dir }}/ci-framework-data" cifmw_openshift_setup_skip_internal_registry: true cifmw_artifacts_basedir: "{{ ansible_user_dir }}/ci-framework-data/artifacts " -cifmw_installyamls_repos: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls" nodepool: cloud: "" mol_config_dir: /home/$(whoami)/src/github.com/openstack-k8s-operators/ci-framework/.config/molecule/config_local.yml diff --git a/group_vars/all.yml b/group_vars/all.yml index 981a942cce..3a84ffffbc 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -5,3 +5,6 @@ ansible_user_dir: "{{ lookup('env', 'HOME') }}" cifmw_project_dir: src/github.com/openstack-k8s-operators/ci-framework cifmw_project_dir_absolute: "{{ ansible_user_dir }}/{{ cifmw_project_dir }}" +cifmw_installyamls_repos_relative: src/github.com/openstack-k8s-operators/install_yamls +# since cifmw_installyamls_repos var already exists, let's use that and move all definition here in single place instead of creating another variable. +cifmw_installyamls_repos: "{{ ansible_user_dir }}/{{ cifmw_installyamls_repos_relative }}" diff --git a/plugins/modules/generate_make_tasks.py b/plugins/modules/generate_make_tasks.py index ec6d0da03d..ff72a9026d 100644 --- a/plugins/modules/generate_make_tasks.py +++ b/plugins/modules/generate_make_tasks.py @@ -42,7 +42,7 @@ - name: Generate make tasks generate_make_tasks: - install_yamls_path: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls/" + install_yamls_path: "{{ cifmw_installyamls_repos }}" output_directory: "{{ ansible_user_dir }}/make_installyamls/tasks" """ # noqa diff --git a/roles/edpm_deploy/molecule/default/prepare.yml b/roles/edpm_deploy/molecule/default/prepare.yml index 9360e433f5..2a57c338aa 100644 --- a/roles/edpm_deploy/molecule/default/prepare.yml +++ b/roles/edpm_deploy/molecule/default/prepare.yml @@ -20,7 +20,6 @@ vars: ansible_user_dir: "{{ lookup('env', 'HOME') }}" cifmw_install_yamls_tasks_out: "{{ ansible_user_dir }}/zuul-jobs/roles/install_yamls_makes/tasks" - cifmw_installyamls_repos: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls" cifmw_install_yamls_defaults: NAMESPACE: openstack roles: diff --git a/roles/edpm_deploy_baremetal/molecule/default/prepare.yml b/roles/edpm_deploy_baremetal/molecule/default/prepare.yml index d3c9a68493..39b3a811a3 100644 --- a/roles/edpm_deploy_baremetal/molecule/default/prepare.yml +++ b/roles/edpm_deploy_baremetal/molecule/default/prepare.yml @@ -21,7 +21,6 @@ ansible_user_dir: "{{ lookup('env', 'HOME') }}" cifmw_basedir: "{{ ansible_user_dir }}/ci-framework-data" cifmw_install_yamls_tasks_out: "{{ ansible_user_dir }}/zuul-jobs/roles/install_yamls_makes/tasks" - cifmw_installyamls_repos: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls" roles: - role: test_deps - role: ci_setup diff --git a/roles/edpm_prepare/molecule/default/prepare.yml b/roles/edpm_prepare/molecule/default/prepare.yml index 59b9ec5050..810486ac1a 100644 --- a/roles/edpm_prepare/molecule/default/prepare.yml +++ b/roles/edpm_prepare/molecule/default/prepare.yml @@ -21,7 +21,6 @@ ansible_user_dir: "{{ lookup('env', 'HOME') }}" cifmw_basedir: "{{ ansible_user_dir }}/ci-framework-data" cifmw_install_yamls_tasks_out: "{{ ansible_user_dir }}/zuul-jobs/roles/install_yamls_makes/tasks" - cifmw_installyamls_repos: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls" cifmw_install_yamls_defaults: NAMESPACE: openstack roles: diff --git a/roles/install_yamls/README.md b/roles/install_yamls/README.md index dc3dbae312..ef2c84756d 100644 --- a/roles/install_yamls/README.md +++ b/roles/install_yamls/README.md @@ -9,7 +9,7 @@ It contains a set of playbooks to deploy podified control plane. * `cifmw_install_yamls_envfile`: (String) Environment file containing all the Makefile overrides. Defaults to `install_yamls`. * `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"`. * `cifmw_install_yamls_vars`: (Dict) A dict containing Makefile overrides. -* `cifmw_install_yamls_repo`: (String) `install_yamls` repo path. Defaults to `{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls`. +* `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')}}` * `cifmw_install_yamls_whitelisted_vars`: (List) Allowed variables in `cifmw_install_yamls_vars` that are not part of `install_yamls` Makefiles. * `cifmw_install_yamls_edpm_dir`: (String) Output directory for EDPM related artifacts (OUTPUT_BASEDIR). Defaults to `{{ cifmw_install_yamls_out_dir_basedir ~ '/artifacts/edpm' }}` * `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 register: "make_crc_storage_status" cifmw.general.ci_script: output_dir: "{{ cifmw_basedir|default(ansible_user_dir ~ '/ci-framework-data') }}/artifacts" - chdir: "/home/zuul/src/github.com/openstack-k8s-operators/install_yamls" + chdir: "{{ cifmw_install_yamls_repo }}" script: make crc_storage dry_run: "{{ make_crc_storage_dryrun|default(false)|bool }}" extra_args: "{{ dict((make_crc_storage_env|default({})), **(make_crc_storage_params|default({}))) }}" @@ -121,7 +121,7 @@ Let's look at below example:- register: "make_ansibleee_cleanup_status" cifmw.general.ci_script: output_dir: "{{ cifmw_basedir|default(ansible_user_dir ~ '/ci-framework-data') }}/artifacts" - chdir: "/home/zuul/src/github.com/openstack-k8s-operators/install_yamls" + chdir: "{{ cifmw_install_yamls_repo }}" script: "make ansibleee_cleanup" dry_run: "{{ make_ansibleee_cleanup_dryrun|default(false)|bool }}" extra_args: "{{ dict((make_ansibleee_cleanup_env|default({})), **(make_ansibleee_cleanup_params|default({}))) }}" diff --git a/roles/install_yamls/molecule/default/converge.yml b/roles/install_yamls/molecule/default/converge.yml index 78ba7be9d2..1835746df9 100644 --- a/roles/install_yamls/molecule/default/converge.yml +++ b/roles/install_yamls/molecule/default/converge.yml @@ -22,7 +22,7 @@ namespace: foobar openstack_ctlplane: controlplane-yaml-file.yaml ansible_user_dir: "{{ lookup('env', 'HOME') }}" - cifmw_install_yamls_repo: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls" + cifmw_install_yamls_repo: "{{ cifmw_installyamls_repos }}" zuul: branch: main items: diff --git a/roles/reproducer/molecule/crc_layout/converge.yml b/roles/reproducer/molecule/crc_layout/converge.yml index bc0f23858d..320bb35056 100644 --- a/roles/reproducer/molecule/crc_layout/converge.yml +++ b/roles/reproducer/molecule/crc_layout/converge.yml @@ -26,7 +26,7 @@ - src: "/tmp/ipmi-things" dest: "/home/zuul/ipmi-things" cifmw_basedir: "/opt/basedir" - cifmw_install_yamls_repo: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls" + cifmw_install_yamls_repo: "{{ cifmw_installyamls_repos }}" cifmw_path: "{{ ansible_user_dir }}/.crc/bin:{{ ansible_user_dir }}/.crc/bin/oc:{{ ansible_user_dir }}/bin:{{ ansible_env.PATH }}" _networks: public: diff --git a/roles/reproducer/tasks/main.yml b/roles/reproducer/tasks/main.yml index 01a681be48..4f1b81479b 100644 --- a/roles/reproducer/tasks/main.yml +++ b/roles/reproducer/tasks/main.yml @@ -300,7 +300,7 @@ _devsetup_path: >- {{ ( - cifmw_install_yamls_repo | default('/home/zuul/src/github.com/openstack-k8s-operators/install_yamls'), + cifmw_installyamls_repos, 'devsetup' ) | ansible.builtin.path_join }} diff --git a/roles/reproducer/tasks/reuse_main.yaml b/roles/reproducer/tasks/reuse_main.yaml index d299115285..a0c4d92a51 100644 --- a/roles/reproducer/tasks/reuse_main.yaml +++ b/roles/reproducer/tasks/reuse_main.yaml @@ -136,7 +136,7 @@ _devsetup_path: >- {{ ( - cifmw_install_yamls_repo | default('/home/zuul/src/github.com/openstack-k8s-operators/install_yamls'), + cifmw_installyamls_repos, 'devsetup' ) | ansible.builtin.path_join }} diff --git a/roles/reproducer/vars/main.yml b/roles/reproducer/vars/main.yml index e8a967bb76..64ebcbfe97 100644 --- a/roles/reproducer/vars/main.yml +++ b/roles/reproducer/vars/main.yml @@ -4,7 +4,7 @@ cifmw_reproducer_default_repositories: - src: "https://github.com/openstack-k8s-operators/ci-framework" dest: "{{ cifmw_project_dir_absolute }}" - src: "https://github.com/openstack-k8s-operators/install_yamls" - dest: "/home/zuul/src/github.com/openstack-k8s-operators/install_yamls" + dest: "{{ cifmw_installyamls_repos }}" - src: "https://github.com/openstack-k8s-operators/architecture" dest: "/home/zuul/src/github.com/openstack-k8s-operators/architecture" diff --git a/roles/tempest/molecule/default/prepare.yml b/roles/tempest/molecule/default/prepare.yml index 59b9ec5050..810486ac1a 100644 --- a/roles/tempest/molecule/default/prepare.yml +++ b/roles/tempest/molecule/default/prepare.yml @@ -21,7 +21,6 @@ ansible_user_dir: "{{ lookup('env', 'HOME') }}" cifmw_basedir: "{{ ansible_user_dir }}/ci-framework-data" cifmw_install_yamls_tasks_out: "{{ ansible_user_dir }}/zuul-jobs/roles/install_yamls_makes/tasks" - cifmw_installyamls_repos: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls" cifmw_install_yamls_defaults: NAMESPACE: openstack roles: diff --git a/roles/tofu/molecule/default/prepare.yml b/roles/tofu/molecule/default/prepare.yml index 3c8642c5a2..d6287b5be6 100644 --- a/roles/tofu/molecule/default/prepare.yml +++ b/roles/tofu/molecule/default/prepare.yml @@ -21,7 +21,6 @@ ansible_user_dir: "{{ lookup('env', 'HOME') }}" cifmw_basedir: "{{ ansible_user_dir }}/ci-framework-data" cifmw_install_yamls_tasks_out: "{{ ansible_user_dir }}/zuul-jobs/roles/install_yamls_makes/tasks" - cifmw_installyamls_repos: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls" cifmw_install_yamls_defaults: NAMESPACE: openstack roles: diff --git a/roles/update/molecule/default/prepare.yml b/roles/update/molecule/default/prepare.yml index 7899e26c1f..15e5eefb1b 100644 --- a/roles/update/molecule/default/prepare.yml +++ b/roles/update/molecule/default/prepare.yml @@ -20,7 +20,6 @@ vars: ansible_user_dir: "{{ lookup('env', 'HOME') }}" cifmw_install_yamls_tasks_out: "{{ ansible_user_dir }}/zuul-jobs/roles/install_yamls_makes/tasks" - cifmw_installyamls_repos: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls" cifmw_install_yamls_defaults: NAMESPACE: openstack roles: diff --git a/scenarios/centos-9/ci.yml b/scenarios/centos-9/ci.yml index 77114ebcf1..a0340e03fc 100644 --- a/scenarios/centos-9/ci.yml +++ b/scenarios/centos-9/ci.yml @@ -1,6 +1,5 @@ --- ansible_user_dir: "{{ lookup('env', 'HOME') }}" -cifmw_installyamls_repos: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls" cifmw_openshift_user: "kubeadmin" cifmw_openshift_password: "123456789" diff --git a/scenarios/centos-9/content_provider.yml b/scenarios/centos-9/content_provider.yml index 96b5bf4fbb..a51b7a9537 100644 --- a/scenarios/centos-9/content_provider.yml +++ b/scenarios/centos-9/content_provider.yml @@ -1,6 +1,5 @@ --- ansible_user_dir: "{{ lookup('env', 'HOME') }}" -cifmw_installyamls_repos: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls" cifmw_operator_build_push_registry: "{{ cifmw_rp_registry_ip | default('localhost') }}:5001" cifmw_operator_build_push_org: "openstack-k8s-operators" cifmw_operator_build_org: "openstack-k8s-operators" diff --git a/scenarios/centos-9/edpm_baremetal_deployment_ci.yml b/scenarios/centos-9/edpm_baremetal_deployment_ci.yml index edf47c28c4..f2a859afea 100644 --- a/scenarios/centos-9/edpm_baremetal_deployment_ci.yml +++ b/scenarios/centos-9/edpm_baremetal_deployment_ci.yml @@ -1,6 +1,5 @@ --- ansible_user_dir: "{{ lookup('env', 'HOME') }}" -cifmw_installyamls_repos: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls" cifmw_install_yamls_vars: DEPLOY_DIR: "{{ cifmw_basedir }}/artifacts/edpm_compute" # used during Baremetal deployment BMAAS_INSTANCE_MEMORY: 8192 diff --git a/scenarios/centos-9/edpm_ci.yml b/scenarios/centos-9/edpm_ci.yml index f803557f6a..dbf9ab6990 100644 --- a/scenarios/centos-9/edpm_ci.yml +++ b/scenarios/centos-9/edpm_ci.yml @@ -1,6 +1,5 @@ --- ansible_user_dir: "{{ lookup('env', 'HOME') }}" -cifmw_installyamls_repos: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls" cifmw_install_yamls_vars: BMO_SETUP: false INSTALL_CERT_MANAGER: false diff --git a/scenarios/centos-9/install_yamls.yml b/scenarios/centos-9/install_yamls.yml index 290ab87556..177806b07d 100644 --- a/scenarios/centos-9/install_yamls.yml +++ b/scenarios/centos-9/install_yamls.yml @@ -1,3 +1,2 @@ --- cifmw_rhol_crc_use_installyamls: true -cifmw_installyamls_repos: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls" diff --git a/scenarios/centos-9/meta_content_provider.yml b/scenarios/centos-9/meta_content_provider.yml index 2904205a5a..a5317f7f22 100644 --- a/scenarios/centos-9/meta_content_provider.yml +++ b/scenarios/centos-9/meta_content_provider.yml @@ -1,6 +1,5 @@ --- ansible_user_dir: "{{ lookup('env', 'HOME') }}" -cifmw_installyamls_repos: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls" # build_operators vars cifmw_operator_build_push_registry: "{{ cifmw_rp_registry_ip }}:{{ cifmw_rp_registry_port }}" diff --git a/scenarios/centos-9/podified_common.yml b/scenarios/centos-9/podified_common.yml index bb0e135d66..c50db2a4b1 100644 --- a/scenarios/centos-9/podified_common.yml +++ b/scenarios/centos-9/podified_common.yml @@ -2,7 +2,6 @@ # It is the common scenario file for EDPM multinode podified deployment ansible_user_dir: "{{ lookup('env', 'HOME') }}" -cifmw_installyamls_repos: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls" cifmw_openshift_user: "kubeadmin" cifmw_openshift_password: "123456789" diff --git a/scenarios/centos-9/tcib.yml b/scenarios/centos-9/tcib.yml index 4cff417831..b28f9ccab1 100644 --- a/scenarios/centos-9/tcib.yml +++ b/scenarios/centos-9/tcib.yml @@ -1,5 +1,4 @@ --- -cifmw_installyamls_repos: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls" ansible_user_dir: "{{ lookup('env', 'HOME') }}" cifmw_build_containers_tcib_src: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/tcib" cifmw_repo_setup_src: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/repo-setup" diff --git a/scenarios/reproducers/3-nodes.yml b/scenarios/reproducers/3-nodes.yml index 3796e14d9e..eb30c5243c 100644 --- a/scenarios/reproducers/3-nodes.yml +++ b/scenarios/reproducers/3-nodes.yml @@ -2,7 +2,6 @@ # This is local to your desktop/laptop. # We can't use ansible_user_dir here, unless you have the same user on the # hypervisor and locally. -cifmw_install_yamls_repo: "~/src/github.com/openstack-k8s-operators/install_yamls" # This will be created on the hypervisor. cifmw_basedir: "{{ ansible_user_dir }}/ci-framework-data" cifmw_path: "{{ ansible_user_dir }}/.crc/bin:{{ ansible_user_dir }}/.crc/bin/oc:{{ ansible_user_dir }}/bin:{{ ansible_env.PATH }}"