mirror of
https://github.com/k3s-io/k3s-ansible.git
synced 2025-12-25 00:12:37 +01:00
fix(ansible): replace deprecated entities and sync version requirements (#478)
* refactor(ansible): replace deprecated with_items and ansible facts Replace deprecated `with_items` with `loop` keyword across all roles. Migrate from legacy `ansible_*` top-level facts to `ansible_facts['*']` syntax to prepare for ansible-core 2.24 where INJECT_FACTS_AS_VARS will default to False. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Aleksei Sviridkin <f@lex.la> * chore(ansible): sync minimum version requirements to 2.15 Align version checks in prereq and airgap roles with README requirement of ansible-core 2.15+. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Aleksei Sviridkin <f@lex.la> --------- Signed-off-by: Aleksei Sviridkin <f@lex.la> Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
e11ff62d8f
commit
826c53975d
@@ -9,8 +9,8 @@
|
||||
block:
|
||||
- name: Verify Ansible meets airgap version requirements.
|
||||
ansible.builtin.assert:
|
||||
that: "ansible_version.full is version_compare('2.12', '>=')"
|
||||
msg: "The Airgap role requires at least ansible-core 2.12"
|
||||
that: "ansible_version.full is version_compare('2.15', '>=')"
|
||||
msg: "The Airgap role requires at least ansible-core 2.15"
|
||||
|
||||
- name: Check for existing install script
|
||||
become: false
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
- name: Determine architecture and set airgap_k3s_arch
|
||||
ansible.builtin.set_fact:
|
||||
airgap_k3s_arch: "{{ 'arm64' if ansible_architecture == 'aarch64' else 'arm' if ansible_architecture == 'armv7l' else 'amd64' }}"
|
||||
airgap_k3s_arch: "{{ 'arm64' if ansible_facts['architecture'] == 'aarch64' else 'arm' if ansible_facts['architecture'] == 'armv7l' else 'amd64' }}"
|
||||
|
||||
- name: Distribute K3s binary
|
||||
ansible.builtin.copy:
|
||||
@@ -71,7 +71,7 @@
|
||||
|
||||
- name: Install K3s SELinux RPM
|
||||
when:
|
||||
- ansible_os_family == 'RedHat'
|
||||
- ansible_facts['os_family'] == 'RedHat'
|
||||
- airgap_selinux_copy.skipped is false
|
||||
ansible.builtin.dnf:
|
||||
name: "{{ airgap_selinux_copy.results[0].dest }}"
|
||||
|
||||
Reference in New Issue
Block a user