-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update version when files in tarball_install change #126
Comments
Hi, thanks for the issue I try the same scenario as you. I've developed a playbook which download tarball, with versions passed in parameters of the playbook. I can check if version is différent from installed rke2 and i have added some variables to disable or enable downgrade or upgrade. Something like this : - name: Get installed version
shell: /usr/local/bin/rke2 -v | head -n 1 | cut -d ' ' -f 3
register: rke2_installed_version
changed_when: false
args:
executable: /bin/bash
when: installed
- name: Check if upgrade is required
ansible.builtin.debug:
msg: "rke2 must be upgraded"
when:
- installed
- tarball_upgrade_enabled
- rke2_installed_version | regex_replace('^v(.*)$','\\1') is version( rke2_version | regex_replace('^v(.*)$','\\1'), '<', version_type='semver')
- name: Set fact for upgrade
set_fact:
upgrade_is_required: true
when:
- installed
- tarball_upgrade_enabled
- rke2_installed_version | regex_replace('^v(.*)$','\\1') is version(rke2_version | regex_replace('^v(.*)$','\\1'), '<', version_type='semver')
- name: Check if downgrade is required
ansible.builtin.debug:
msg: "rke2 must be downgraded"
when:
- installed
- tarball_downgrade_enabled
- rke2_installed_version | regex_replace('^v(.*)$','\\1') is version(rke2_version | regex_replace('^v(.*)$','\\1'), '>', version_type='semver')
- name: Set fact for downgrade
set_fact:
downgrade_is_required: true
when:
- installed
- tarball_downgrade_enabled
- rke2_installed_version | regex_replace('^v(.*)$','\\1') is version(rke2_version | regex_replace('^v(.*)$','\\1'), '>', version_type='semver') And I've updated the main.yaml in common file by updating the when block: - include: images_tarball_install.yml
when: not installed or upgrade_is_required or downgrade_is_required
....
- name: SLES/Ubuntu/Tarball Installation
include: tarball_install.yml
when:
- |-
((ansible_facts['os_family'] != 'RedHat' and
ansible_facts['os_family'] != 'Rocky') or
rke2_binary_tarball_check.stat.exists == true)
and ( not installed or upgrade_is_required ) I don't know if I can open a PR, because it's a special use case which a version for rke2 is mandatory in my playbook, but it doesn't exist in this rke2 install role |
@audig thxs for the code. From my point of view, i think it's a good idea that you create a PR with your code. The possibility to upgrade or downgrade an installation is a good feature. |
@lynchmaniac Just as a tip, you can automate this by using the upgrade-system-controller in your RKE2 cluster and adding 2 plans. 1 for the servers and 1 for the agent nodes, then you only need to change the RKE2 versions in those files then the controller do the upgrade for you. |
@Richardswe Thanks a lot for the tip 😃 |
resolved in #153 |
Hi, This role work fine when i want to install, in an airgap way, a version of RKE2 on multi node (3 masters and 3 workers for example). But if i replace the actual
rke2-images.linux-amd64.tar.zst
andrke2.linux-amd64.tar.gz
by some nexer artefact, the update doesn't work.Scenario :
rke2-images.linux-amd64-1.23.5.tar.zst
andrke2.linux-amd64-1.23.5.tar.gz
tarball_install
folder with namerke2-images.linux-amd64.tar.zst
andrke2.linux-amd64.tar.gz
rke2-images.linux-amd64-1.24.3.tar.zst
andrke2.linux-amd64-1.24.3.tar.gz
It's logical if you look at the code :
main/roles/rke2_common/tasks/main.yml
Is it in the roadmap to implement the update of the version of RKE2 when files in tarball_install folder change ?
The text was updated successfully, but these errors were encountered: