From e2a4adef6b1b43032fc728f96c1ecddd5cd90ffb Mon Sep 17 00:00:00 2001 From: Chandan Kumar Date: Fri, 2 Aug 2024 14:01:59 +0530 Subject: [PATCH] Add _openstack_final_env to set final env filename Currently we store all the operator env variables in operator_env.txt. Since this role is used twice in update job. We need a var to store the env variable before update and after update. cifmw_set_openstack_containers_openstack_final_env will help to achieve the same. Signed-off-by: Chandan Kumar --- playbooks/update.yml | 1 + roles/set_openstack_containers/README.md | 1 + roles/set_openstack_containers/defaults/main.yml | 1 + roles/set_openstack_containers/tasks/main.yml | 4 ++-- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/playbooks/update.yml b/playbooks/update.yml index 2fedc0dd9f..c0f9125f47 100644 --- a/playbooks/update.yml +++ b/playbooks/update.yml @@ -35,6 +35,7 @@ cifmw_set_openstack_containers_tag_from_md5: true cifmw_set_openstack_containers_extra_vars: "{{ cifmw_edpm_prepare_extra_vars }}" cifmw_set_openstack_containers_openstack_version_change: true + cifmw_set_openstack_containers_openstack_final_env: "operator_env_after_update.txt" ansible.builtin.include_role: name: set_openstack_containers diff --git a/roles/set_openstack_containers/README.md b/roles/set_openstack_containers/README.md index 28c921df98..050ac38d27 100644 --- a/roles/set_openstack_containers/README.md +++ b/roles/set_openstack_containers/README.md @@ -18,6 +18,7 @@ The role will generate two 2 files in ~/ci-framework-data/artifacts/ directory a * `cifmw_set_openstack_containers_prefix`: Update container containing. Defaults to `openstack` * `cifmw_set_openstack_containers_openstack_version_change`: (Boolean) Set environment variables for openstack services containers for specific OPENSTACK_RELEASE_VERSION defined in cifmw_set_openstack_containers_update_target_version. It should be used only for meta openstack operator in prepare for openstack minor update. Defaults to `false`. * `cifmw_set_openstack_containers_update_target_version`: Value of OPENSTACK_RELEASE_VERSION env in openstack operator that should be set. Defaults to `0.0.2`. +* `cifmw_set_openstack_containers_openstack_final_env`: File name to store the operator env in a file. Default to `operator_env.txt`. ## Examples diff --git a/roles/set_openstack_containers/defaults/main.yml b/roles/set_openstack_containers/defaults/main.yml index 1860e0487f..adc9f19c00 100644 --- a/roles/set_openstack_containers/defaults/main.yml +++ b/roles/set_openstack_containers/defaults/main.yml @@ -27,6 +27,7 @@ cifmw_set_openstack_containers_tag_from_md5: false cifmw_set_openstack_containers_dlrn_md5_path: "/etc/yum.repos.d/delorean.repo.md5" cifmw_set_openstack_containers_openstack_version_change: false cifmw_set_openstack_containers_update_target_version: "0.0.2" +cifmw_set_openstack_containers_openstack_final_env: "operator_env.txt" # Set custom image url for non-openstack images cifmw_set_openstack_containers_overrides: {} diff --git a/roles/set_openstack_containers/tasks/main.yml b/roles/set_openstack_containers/tasks/main.yml index 914374211c..7d8fbd39c1 100644 --- a/roles/set_openstack_containers/tasks/main.yml +++ b/roles/set_openstack_containers/tasks/main.yml @@ -149,6 +149,6 @@ PATH: "{{ cifmw_path }}" cifmw.general.ci_script: output_dir: "{{ cifmw_set_openstack_containers_basedir }}/artifacts" - script: "oc set env {{ operator_pod_name }} -n {{ cifmw_install_yamls_defaults['OPERATOR_NAMESPACE'] }} --list > operator_env.txt" + script: "oc set env {{ operator_pod_name }} -n {{ cifmw_install_yamls_defaults['OPERATOR_NAMESPACE'] }} --list > {{ cifmw_set_openstack_containers_openstack_final_env }}" chdir: "{{ cifmw_set_openstack_containers_basedir }}/artifacts" - creates: operator_env.txt + creates: "{{ cifmw_set_openstack_containers_openstack_final_env }}"