diff --git a/docs/dictionary/en-custom.txt b/docs/dictionary/en-custom.txt index 6d203d5edd..1c4ee523ce 100644 --- a/docs/dictionary/en-custom.txt +++ b/docs/dictionary/en-custom.txt @@ -421,6 +421,7 @@ openstacksdk openstackversion operatorgroup operatorhub +opm opn orchestrator osd diff --git a/roles/install_yamls/README.md b/roles/install_yamls/README.md index ef2c84756d..e613a87c38 100644 --- a/roles/install_yamls/README.md +++ b/roles/install_yamls/README.md @@ -14,6 +14,10 @@ It contains a set of playbooks to deploy podified control plane. * `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 when cloning operator's repository using install_yamls make targets. Defaults to `"true"` +* `cifmw_install_yamls_opm_version`: (String) Override the opm version in install_yamls devsetup/vars/default.yaml. Example: `v1.30.0` +* `cifmw_install_yamls_sdk_version`: (String) Override the operator-sdk version in install_yamls devsetup/vars/default.yaml. Example: `v1.41.1` +* `cifmw_install_yamls_go_version`: (String) Override the golang version in install_yamls devsetup/vars/default.yaml. Example: `1.24.6` +* `cifmw_install_yamls_kustomize_version`: (String) Override the kustomize version in install_yamls devsetup/vars/default.yaml. Example: `v5.0.3` ## cifmw_install_yamls_vars patching diff --git a/roles/install_yamls/defaults/main.yml b/roles/install_yamls/defaults/main.yml index 5a2b7e7b66..227195c175 100644 --- a/roles/install_yamls/defaults/main.yml +++ b/roles/install_yamls/defaults/main.yml @@ -39,3 +39,10 @@ cifmw_install_yamls_whitelisted_vars: # Defines in install_yamls when we should clone and checkout based on # openstack-operator references. cifmw_install_yamls_checkout_openstack_ref: "true" + +# Variables to customize install_yamls devsetup/vars/default.yaml +# These variables allow overriding the default versions of tools used by install_yamls +# cifmw_install_yamls_opm_version: v1.30.0 +# cifmw_install_yamls_sdk_version: v1.41.1 +# cifmw_install_yamls_go_version: 1.24.6 +# cifmw_install_yamls_kustomize_version: v5.0.3 diff --git a/roles/install_yamls/tasks/customize_devsetup_vars.yml b/roles/install_yamls/tasks/customize_devsetup_vars.yml new file mode 100644 index 0000000000..6e329b3f0c --- /dev/null +++ b/roles/install_yamls/tasks/customize_devsetup_vars.yml @@ -0,0 +1,54 @@ +--- +# Copyright Red Hat, Inc. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +- name: Customize install_yamls devsetup vars + when: > + cifmw_install_yamls_opm_version is defined or + cifmw_install_yamls_sdk_version is defined or + cifmw_install_yamls_go_version is defined or + cifmw_install_yamls_kustomize_version is defined + block: + - name: Update opm_version in install_yamls devsetup/vars/default.yaml + when: cifmw_install_yamls_opm_version is defined + ansible.builtin.lineinfile: + path: "{{ cifmw_install_yamls_repo }}/devsetup/vars/default.yaml" + regexp: '^opm_version:' + line: "opm_version: {{ cifmw_install_yamls_opm_version }}" + state: present + + - name: Update sdk_version in install_yamls devsetup/vars/default.yaml + when: cifmw_install_yamls_sdk_version is defined + ansible.builtin.lineinfile: + path: "{{ cifmw_install_yamls_repo }}/devsetup/vars/default.yaml" + regexp: '^sdk_version:' + line: "sdk_version: {{ cifmw_install_yamls_sdk_version }}" + state: present + + - name: Update go_version in install_yamls devsetup/vars/default.yaml + when: cifmw_install_yamls_go_version is defined + ansible.builtin.lineinfile: + path: "{{ cifmw_install_yamls_repo }}/devsetup/vars/default.yaml" + regexp: '^go_version:' + line: "go_version: {{ cifmw_install_yamls_go_version }}" + state: present + + - name: Update kustomize_version in install_yamls devsetup/vars/default.yaml + when: cifmw_install_yamls_kustomize_version is defined + ansible.builtin.lineinfile: + path: "{{ cifmw_install_yamls_repo }}/devsetup/vars/default.yaml" + regexp: '^kustomize_version:' + line: "kustomize_version: {{ cifmw_install_yamls_kustomize_version }}" + state: present diff --git a/roles/install_yamls/tasks/main.yml b/roles/install_yamls/tasks/main.yml index e78b1d9f6c..de8ac8dde5 100644 --- a/roles/install_yamls/tasks/main.yml +++ b/roles/install_yamls/tasks/main.yml @@ -33,6 +33,13 @@ name: install_yamls tasks_from: zuul_set_operators_repo.yml +- name: Customize install_yamls devsetup vars if needed + tags: + - bootstrap + ansible.builtin.include_role: + name: install_yamls + tasks_from: customize_devsetup_vars.yml + - name: Compute the cifmw_install_yamls_vars final value tags: - bootstrap