* chore: update readme and workflows Signed-off-by: Devin Buhl <devin@buhl.casa> * fix: ansible templating Signed-off-by: Devin Buhl <devin@buhl.casa> * fix: talos templating Signed-off-by: Devin Buhl <devin@buhl.casa> --------- Signed-off-by: Devin Buhl <devin@buhl.casa>
19 lines
709 B
YAML
19 lines
709 B
YAML
---
|
|
- name: Version Check
|
|
block:
|
|
- name: Get deployed k3s version
|
|
ansible.builtin.command: k3s --version
|
|
register: k3s_version
|
|
changed_when: false
|
|
failed_when: false
|
|
|
|
- name: Extract k3s version
|
|
ansible.builtin.set_fact:
|
|
current_k3s_version: "{% raw %}{{ k3s_version.stdout | regex_replace('(?im)k3s version (?P<version>[a-z0-9\\.\\+]+).*\n.*', '\\g<version>') }}{% endraw %}"
|
|
|
|
- name: Check if upgrades are allowed
|
|
ansible.builtin.assert:
|
|
that:
|
|
- "k3s_release_version is version(current_k3s_version, '>=')"
|
|
fail_msg: "Unable to upgrade k3s because the deployed version is higher than the one specified in the configuration"
|