Skip to content

Commit 0032196

Browse files
dprincedanpawlik
authored andcommitted
Add support for customizing install_yamls devsetup tool versions
This change introduces the ability to override default tool versions used by install_yamls devsetup. Users can now customize versions for: - OPM (cifmw_install_yamls_opm_version) - Operator SDK (cifmw_install_yamls_sdk_version) - Golang (cifmw_install_yamls_go_version) - Kustomize (cifmw_install_yamls_kustomize_version) The new customize_devsetup_vars.yml task updates the install_yamls devsetup/vars/default.yaml file when any of these variables are defined. Signed-off-by: Dan Prince <[email protected]>
1 parent 84c46b6 commit 0032196

File tree

5 files changed

+73
-0
lines changed

5 files changed

+73
-0
lines changed

docs/dictionary/en-custom.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ openstacksdk
421421
openstackversion
422422
operatorgroup
423423
operatorhub
424+
opm
424425
opn
425426
orchestrator
426427
osd

roles/install_yamls/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ It contains a set of playbooks to deploy podified control plane.
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
1616
when cloning operator's repository using install_yamls make targets. Defaults to `"true"`
17+
* `cifmw_install_yamls_opm_version`: (String) Override the opm version in install_yamls devsetup/vars/default.yaml. Example: `v1.30.0`
18+
* `cifmw_install_yamls_sdk_version`: (String) Override the operator-sdk version in install_yamls devsetup/vars/default.yaml. Example: `v1.41.1`
19+
* `cifmw_install_yamls_go_version`: (String) Override the golang version in install_yamls devsetup/vars/default.yaml. Example: `1.24.6`
20+
* `cifmw_install_yamls_kustomize_version`: (String) Override the kustomize version in install_yamls devsetup/vars/default.yaml. Example: `v5.0.3`
1721

1822
## cifmw_install_yamls_vars patching
1923

roles/install_yamls/defaults/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,10 @@ cifmw_install_yamls_whitelisted_vars:
3939
# Defines in install_yamls when we should clone and checkout based on
4040
# openstack-operator references.
4141
cifmw_install_yamls_checkout_openstack_ref: "true"
42+
43+
# Variables to customize install_yamls devsetup/vars/default.yaml
44+
# These variables allow overriding the default versions of tools used by install_yamls
45+
# cifmw_install_yamls_opm_version: v1.30.0
46+
# cifmw_install_yamls_sdk_version: v1.41.1
47+
# cifmw_install_yamls_go_version: 1.24.6
48+
# cifmw_install_yamls_kustomize_version: v5.0.3
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
# Copyright Red Hat, Inc.
3+
# All Rights Reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
6+
# not use this file except in compliance with the License. You may obtain
7+
# a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
# License for the specific language governing permissions and limitations
15+
# under the License.
16+
17+
- name: Customize install_yamls devsetup vars
18+
when: >
19+
cifmw_install_yamls_opm_version is defined or
20+
cifmw_install_yamls_sdk_version is defined or
21+
cifmw_install_yamls_go_version is defined or
22+
cifmw_install_yamls_kustomize_version is defined
23+
block:
24+
- name: Update opm_version in install_yamls devsetup/vars/default.yaml
25+
when: cifmw_install_yamls_opm_version is defined
26+
ansible.builtin.lineinfile:
27+
path: "{{ cifmw_install_yamls_repo }}/devsetup/vars/default.yaml"
28+
regexp: '^opm_version:'
29+
line: "opm_version: {{ cifmw_install_yamls_opm_version }}"
30+
state: present
31+
32+
- name: Update sdk_version in install_yamls devsetup/vars/default.yaml
33+
when: cifmw_install_yamls_sdk_version is defined
34+
ansible.builtin.lineinfile:
35+
path: "{{ cifmw_install_yamls_repo }}/devsetup/vars/default.yaml"
36+
regexp: '^sdk_version:'
37+
line: "sdk_version: {{ cifmw_install_yamls_sdk_version }}"
38+
state: present
39+
40+
- name: Update go_version in install_yamls devsetup/vars/default.yaml
41+
when: cifmw_install_yamls_go_version is defined
42+
ansible.builtin.lineinfile:
43+
path: "{{ cifmw_install_yamls_repo }}/devsetup/vars/default.yaml"
44+
regexp: '^go_version:'
45+
line: "go_version: {{ cifmw_install_yamls_go_version }}"
46+
state: present
47+
48+
- name: Update kustomize_version in install_yamls devsetup/vars/default.yaml
49+
when: cifmw_install_yamls_kustomize_version is defined
50+
ansible.builtin.lineinfile:
51+
path: "{{ cifmw_install_yamls_repo }}/devsetup/vars/default.yaml"
52+
regexp: '^kustomize_version:'
53+
line: "kustomize_version: {{ cifmw_install_yamls_kustomize_version }}"
54+
state: present

roles/install_yamls/tasks/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@
3333
name: install_yamls
3434
tasks_from: zuul_set_operators_repo.yml
3535

36+
- name: Customize install_yamls devsetup vars if needed
37+
tags:
38+
- bootstrap
39+
ansible.builtin.include_role:
40+
name: install_yamls
41+
tasks_from: customize_devsetup_vars.yml
42+
3643
- name: Compute the cifmw_install_yamls_vars final value
3744
tags:
3845
- bootstrap

0 commit comments

Comments
 (0)